0.节点配置

节点名称 ip 配置
控制节点(controller) 两个,一个管理网、一个计算网 2C/8G
计算节点(compute-node-1) 两个,一个管理网、一个计算网 4C/8G
存储节点(block-node-1) 两个,一个管理网、一个计算网 1C/1G/100G

1.关闭防火墙、selinux(所有节点)

  1. #关闭防火墙
  2. systemctl stop firewalld
  3. systemctl disable firewalld
  4. systemctl status firewalld
  5. #关闭seliinux
  6. setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

2、配置主机名(所有节点)

  1. hostnamectl set-hostname [hostname]
  2. #将每个主机的域名映射写入到hosts文件
  3. vim /etc/hosts

3、配置时间同步(所有节点)

1、控制节点

  1. #1.安装chrony
  2. yum install chrony -y
  3. #2.修改配置
  4. vim /etc/chrony.conf
  5. server controller iburst #使用本地作为时间同步服务器
  6. allow 10.0.0.0/24 #允许访问的网段
  7. local stratum 10
  8. #启动
  9. server controller iburst
  10. systemctl enable chronyd.service
  11. systemctl restart chronyd.service
  12. ntpdate controller
  13. #验证
  14. chronyc sources

2、其他节点

  1. #1.安装chrony
  2. yum install chrony -y
  3. #2.修改配置
  4. vim /etc/chrony.conf
  5. server controller iburst #使用控制节点作为时间同步服务器
  6. #启动
  7. server controller iburst
  8. systemctl enable chronyd.service
  9. systemctl restart chronyd.service
  10. ntpdate controller
  11. #验证
  12. chronyc sources

4、配置openstack源(所有节点)

1.第一种:使用官方的源

  1. #安装yum源(所有节点)
  2. yum install centos-release-openstack-train -y && yum upgrade -y
  3. #安装客户端(控制节点)
  4. yum install python-openstackclient -y #控制节点安装即可
  5. #管理selinux(所有节点)
  6. yum install openstack-selinux -y

2.第二种:配置国内镜像源

  1. #kvm yum源
  2. http://mirrors.sohu.com/centos/7.5.1804/virt/x86_64/kvm-common/
  3. #openstack 镜像源yum
  4. [openStack]
  5. name=openStack yum repository
  6. baseurl=http://mirrors.163.com/centos/7/cloud/x86_64/openstack-train/
  7. enabled=1
  8. gpgcheck=0

5、安装mariadb数据库(控制节点)

  1. #安装
  2. yum install mariadb mariadb-server python2-PyMySQL -y
  3. #配置
  4. cp /etc/my.cnf /etc/my.cnf.bak
  5. vim /etc/my.cnf <<-EOF
  6. [mysqld]
  7. bind-address = controller
  8. default-storage-engine = innodb
  9. innodb_file_per_table = on
  10. max_connections = 4096
  11. collation-server = utf8_general_ci
  12. character-set-server = utf8
  13. EOF
  14. #启动
  15. systemctl enable mariadb.service
  16. systemctl start mariadb.service
  17. systemctl status mariadb.service
  18. #初始化
  19. mysql_secure_installation
  20. #验证
  21. mysql -uroot -p123456 -e " show databases;"

6、安装rabbitmq(控制节点)

  1. #安装启动
  2. yum install rabbitmq-server -y
  3. systemctl enable rabbitmq-server.service
  4. systemctl start rabbitmq-server.service
  5. systemctl status rabbitmq-server.service
  6. #添加用户
  7. rabbitmqctl add_user openstack openstack
  8. #允许openstack用户进行配置、写入和读取访问:
  9. rabbitmqctl set_permissions openstack ".*" ".*" ".*"
  10. #验证
  11. rabbitmqctl status

7、安装memcache(控制节点)

  1. #安装
  2. yum install memcached python-memcached -y
  3. #配置
  4. vim /etc/sysconfig/memcached
  5. OPTIONS="-l 127.0.0.1,::1,controller"
  6. #启动
  7. systemctl enable memcached.service
  8. systemctl start memcached.service
  9. systemctl status memcached