配置说明:controller IP:192.168.0.111 Compute IP: 192.168.0.1121.网络配置.Controller DEVICE=ens33ONBOOT=yesIPADDR=192.168.0.111PREFIX0=24GATEWAY=192.168.0.254DNS1=192.168.0.254Compute DEVICE=ens33ONBOOT=yesIPADDR=192.168.0.112PREFIX0=24GATEWAY=192.168.0.254DNS1=192.168.0.254关闭两台服务器的iptables 和 selinux(1)关闭防火墙systemctl stop firewalld.servicesystemctl disable firewalld.service(2)关闭selinuxsetenforce 0[root@compute ~]# setenforce 0[root@compute ~]# cat /etc/selinux/config SELINUX=disabledSELINUXTYPE=targeted 2.NTP服务的搭建Controller安装chrony时间同步服务(系统默认是安装),如果没有安装就安装。[root@controller ~]# rpm -qa | grep chronychrony-2.1.1-4.el7.centos.x86_64[root@controller ~]#yum -y install chrony[root@controller ~]# vi /etc/chrony.conf 安装好后,需要修改配置文件,如下所示:启动ntp服务 [root@controller ~]# systemctl start chronyd.service 启动ntp服务[root@controller ~]# systemctl status chronyd.service 查看时间同步状态[root@controller ~]# chronyc sources -v 查看时间同步源[root@controller ~]# chronyc sourcestats -v 查看时间同步源状态Compute ntp的安装和部署安装同上一样,安装好后修改配置文件[root@compute ~]# vi /etc/chrony.conf 启动服务和查看是否正常同上。############################ controller Openstack包安装和部署##########################一.MYSQL服务[root@controller ~]# yum -y install mariadb mariadb-server python2-PyMySQL 安装46个包[root@controller ~]# cd /etc/my.cnf.d/[root@controller my.cnf.d]# vi mariadb-openstack.cnf[root@controller my.cnf.d]# cat mariadb-openstack.cnf[mysqld]default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = 'SET NAMES utf8'character-set-server = utf8bind-address = 192.168.0.111[root@controller ~]# systemctl enable mariadb.service[root@controller ~]# systemctl start mariadb.service[root@controller ~]# netstat -anpult | grep mysqldtcp 0 0 192.168.0.111:3306 0.0.0.0: LISTEN 2990/mysqld 初始化数据库[root@controller ~]# mysql_secure_installationEnter current password for root (enter for none): 选择回车Set root password? [Y/n] y设置密码及初始化密码 devops ,一路y回车 [root@controller ~]# mysql -uroot -pdevops创建数据库[root@controller ~]# mysql -uroot -pdevopsWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 12Server version: 10.1.20-MariaDB MariaDB ServerCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE keystone;MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone. TO 'keystone'@'localhost' IDENTIFIED BY 'devops';MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone. TO 'keystone'@'%' IDENTIFIED BY 'devops';二.RabbitMQ服务的安装[root@controller ~]# yum -y install erlang [root@controller ~]# yum install -y rabbitmq-server [root@controller ~]# systemctl enable rabbitmq-server.service[root@controller ~]# systemctl start rabbitmq-server.service[root@controller ~]# systemctl status rabbitmq-server.service[root@controller ~]# systemctl list-unit-files |grep rabbitmq-server.service[root@controller ~]# rabbitmqctl add_user openstack devops 用户名为:openstack 密码:devopsCreating user "openstack" ...[root@controller ~]# rabbitmqctl set_user_tags openstack administrator 设置openstack为管理员Setting tags for user "openstack" to [administrator] ...[root@controller ~]# rabbitmqctl set_permissions openstack "." "." "."Setting permissions for user "openstack" in vhost "/" ...[root@controller ~]# rabbitmq-plugins list 查看支持的插件[root@controller ~]# rabbitmq-plugins enable rabbitmq_management 启动插件Plugin configuration unchanged.Applying plugin configuration to rabbit@controller... started 6 plugins.[root@controller ~]# systemctl restart rabbitmq-server.service[root@controller ~]# lsof -i :15672测试rabbitMQ是否正常
所有的配置文件在百度云盘中:链接:https://pan.baidu.com/s/1CnmKkFMTemv199ctgb5Oig 提取码:27om 复制这段内容后打开百度网盘手机App,操作更方便哦