一、实验说明
按照官方文档搭建queens版本openstack,拓扑如下图所示:
二、实验目的
准备好openstack组件安装前所需要的其他软件,如MariaDB,RabbitMQ等。
三、操作步骤
修改所有节点/etc/hosts文件
如果hosts文件中有将主机名解析到127.0.0.1的配置段,将其注销
所有节点关闭NetworkManager
[[email protected] ~]# systemctl stop NetworkManager.service
[[email protected] ~]# systemctl disable NetworkManager.service
所有节点添加openstack需要的yum源
[[email protected] ~]# vim /etc/yum.repo.d/OpenStack-Queens.repo
[OpenStack-Queens]
name=OpenStack-Queens
baseurl=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-queens/
enable=1
gpgcheck=0
安装NTP服务
controller节点进行以下操作:
-
安装并设置允许同步的网段
[[email protected] ~]# yum install chrony
[[email protected] ~]# vim /etc/chrony.conf
allow 172.16.80.0/24
-
启动NTP服务并同步测试
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service
[[email protected] ~]# chronyc sources
其他节点进行以下操作:
-
安装NTP并设置向controller进行时间同步
[[email protected] ~]# yum install chrony
[[email protected] ~]# vim /etc/chrony.conf
server controller iburst
-
启动服务并验证同步
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service
[[email protected] ~]# chronyc sources
安装数据库
-
安装并编辑配置文件
[[email protected] ~]# yum install mariadb mariadb-server python2-PyMySQL
[[email protected] ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld] bind-address = 172.16.80.10 default-storage-engine = innodb innodb_file_per_table = on max_connections = 4096 collation-server = utf8_general_ci character-set-server = utf8 skip_name_resolve = 1
-
启动数据库
[[email protected] ~]# systemctl enable mariadb.service
[[email protected] ~]# systemctl start mariadb.service
安装消息中间件
-
安装rabbitmq中间件
[[email protected] ~]# yum install rabbitmq-server
-
加载rabbitmq_management插件启用图形界面
[[email protected] ~]# rabbitmq-plugins enable rabbitmq_management
[[email protected] ~]# systemctl start rabbitmq-server.service
-
为openstack创建用户并授权
[[email protected] ~]# rabbitmqctl add_user openstack password1!
[[email protected] ~]# rabbitmqctl set_permissions openstack "." "." ".*"
安装认证缓存
-
安装程序包
[[email protected] ~]# yum install memcached python-memcached
-
配置并启用程序
[[email protected] ~]# vim /etc/sysconfig/memcached
[[email protected] ~]# systemctl enable memcached.service
[[email protected] ~]# systemctl start memcached.service
安装分布式密钥存储
-
下载安装包
[[email protected] ~]# yum install etcd
-
编辑配置文件并启动
[[email protected] ~]# vim /etc/etcd/etcd.conf
#[Member] ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="http://172.16.80.10:2380" ETCD_LISTEN_CLIENT_URLS="http://172.16.80.10:2379" ETCD_NAME="controller" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="http://172.16.80.10:2380" ETCD_ADVERTISE_CLIENT_URLS="http://172.16.80.10:2379" ETCD_INITIAL_CLUSTER="controller=http://172.16.80.10:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01" ETCD_INITIAL_CLUSTER_STATE="new"
[[email protected] ~]# systemctl enable etcd
[[email protected] ~]# systemctl start etcd
至此,openstack安装前准备工作全部完成。
转载于:https://blog.51cto.com/arkling/2133898