zsyzhou 发表于 2017-6-26 18:36:05

OpenStack安装部署(二)

  中文文档:http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/
提示:这个中文文档是直接翻译过来的,所以会有很多不通顺的地方。

服务介绍
  MySQL:为各个服务提供数据存储
RabbitMq:为各个服务之间通信提供认证和服务注册
Keystone:为各个服务器之间通讯提供认证和服务注册
Glance:为虚拟机提供镜像管理
Nova:为虚拟机提供计算资源
Neutron:为虚拟机提供网络资源

安装部署
  1、基础环境
  两台CentOS 7主机,地址192.168.137.11、192.16.137.12
  192.168.137.11主机为控制节点,部署架构如下图
  
  192.16.137.12为计算节点,部署架构如下图
  
  本次我们安装Openstack M版,M版是在2016-4月发布的
  安装时间同步



yum install ntpdate -y
ntpdate time1.aliyun.com
timedatectl set-timezone Asia/Shanghai
  2、准备
  安装EPEL仓库



rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

  安装Openstack仓库



yum install -y centos-release-openstack-mitaka
# 安装完成后会在/etc/yum.repos.d/下生成CentOS-OpenStack-mitaka.repo

  3、安装Openstack客户端



yum install -y python-openstackclient

  4、安装openstack SELinux管理包



yum install -y openstack-selinux

  如果我们没有进行关闭selinux openstack-selinux就会自动帮我们设置
  5、基础服务安装
  
  1)安装数据库



yum install -y mariadb mariadb-server python2-PyMySQL
cd /etc/my.cnf.d/
vim openstack.cnf

bind-address = 192.168.137.11   # 监听的IP地址(也可以写0.0.0.0)
default-storage-engine = innodb# 默认存储引擎
innodb_file_per_table       # 使用独享表空间
max_connections = 4096          # 最大连接数是4096 (默认是1024)
collation-server = utf8_general_ci# 数据库默认校对规则
character-set-server = utf8# 默认字符集

  启动数据库



systemctl enable mariadb.service
systemctl start mariadb.service

  为了保证数据库服务的安全性,运行``mysql_secure_installation``脚本。特别需要说明的是,为数据库的root用户设置一个适当的密码。



mysql_secure_installation
  创建认证服务的数据库并进行授权



mysql -uroot -p123456
create database keystone;# 创建keystone数据库
grant all on keystone.* to 'keystone'@'localhost' identified by 'keystone';
grant all on keystone.* to 'keystone'@'%' identified by 'keystone';

  创建镜像数据库并进行授权



create database glance;# 创建glance数据库
grant all on glance.* to 'glance'@'localhost' identified by 'glance';
grant all on glance.* to 'glance'@'%' identified by 'glance';

  创建资源数据库并进行授权



create database nova;# 创建nova数据库
grant all on nova.* to 'nova'@'localhost' identified by 'nova';
grant all on nova.* to 'nova'@'%' identified by 'nova';

  创建nova-api数据库



create database nova_api;
grant all on nova_api.* to 'nova'@'localhost' identified by 'nova';
grant all on nova_api.* to 'nova'@'%' identified by 'nova';

  创建网络资源管理数据库



create database neutron;
grant all on neutron.* to 'neutron'@'localhost' identified by 'neutron';
grant all on neutron.* to 'neutron'@'%' identified by 'neutro

  2)消息队列安装



yum install rabbitmq-server -y

  启动消息队列服务并将其配置为开机自启动



systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service

  添加openstack用户




rabbitmqctl add_user openstack openstack

  给openstack用户读写权限



rabbitmqctl set_permissions openstack ".*" ".*" ".*"
.*分别代表配置、写入、读取

  开启rabbitmq WEB页面插件



rabbitmq-plugins enable rabbitmq_management

  访问http://192.168.137.11:15672/,默认账号密码:guest/guest
页: [1]
查看完整版本: OpenStack安装部署(二)