0.节点配置
节点名称 |
ip |
配置 |
控制节点(controller) |
两个,一个管理网、一个计算网 |
2C/8G |
计算节点(compute-node-1) |
两个,一个管理网、一个计算网 |
4C/8G |
存储节点(block-node-1) |
两个,一个管理网、一个计算网 |
1C/1G/100G |
1.关闭防火墙、selinux(所有节点)
#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
#关闭seliinux
setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
2、配置主机名(所有节点)
hostnamectl set-hostname [hostname]
#将每个主机的域名映射写入到hosts文件
vim /etc/hosts
3、配置时间同步(所有节点)
1、控制节点
#1.安装chrony
yum install chrony -y
#2.修改配置
vim /etc/chrony.conf
server controller iburst #使用本地作为时间同步服务器
allow 10.0.0.0/24 #允许访问的网段
local stratum 10
#启动
server controller iburst
systemctl enable chronyd.service
systemctl restart chronyd.service
ntpdate controller
#验证
chronyc sources
2、其他节点
#1.安装chrony
yum install chrony -y
#2.修改配置
vim /etc/chrony.conf
server controller iburst #使用控制节点作为时间同步服务器
#启动
server controller iburst
systemctl enable chronyd.service
systemctl restart chronyd.service
ntpdate controller
#验证
chronyc sources
4、配置openstack源(所有节点)
1.第一种:使用官方的源
#安装yum源(所有节点)
yum install centos-release-openstack-train -y && yum upgrade -y
#安装客户端(控制节点)
yum install python-openstackclient -y #控制节点安装即可
#管理selinux(所有节点)
yum install openstack-selinux -y
2.第二种:配置国内镜像源
#kvm yum源
http://mirrors.sohu.com/centos/7.5.1804/virt/x86_64/kvm-common/
#openstack 镜像源yum
[openStack]
name=openStack yum repository
baseurl=http://mirrors.163.com/centos/7/cloud/x86_64/openstack-train/
enabled=1
gpgcheck=0
5、安装mariadb数据库(控制节点)
#安装
yum install mariadb mariadb-server python2-PyMySQL -y
#配置
cp /etc/my.cnf /etc/my.cnf.bak
vim /etc/my.cnf <<-EOF
[mysqld]
bind-address = controller
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
EOF
#启动
systemctl enable mariadb.service
systemctl start mariadb.service
systemctl status mariadb.service
#初始化
mysql_secure_installation
#验证
mysql -uroot -p123456 -e " show databases;"
6、安装rabbitmq(控制节点)
#安装启动
yum install rabbitmq-server -y
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
systemctl status rabbitmq-server.service
#添加用户
rabbitmqctl add_user openstack openstack
#允许openstack用户进行配置、写入和读取访问:
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
#验证
rabbitmqctl status
7、安装memcache(控制节点)
#安装
yum install memcached python-memcached -y
#配置
vim /etc/sysconfig/memcached
OPTIONS="-l 127.0.0.1,::1,controller"
#启动
systemctl enable memcached.service
systemctl start memcached.service
systemctl status memcached