1. 两台虚拟机,安装Centos7系统
两个网卡 -- 一个NAT模式,一个仅主机模式
两个硬盘 -- 一个20GB,一个50GB
内存 -- 主 2.6GB(根据自己的配置,大于2G即可)
从 1.6 GB
2. 配置网络 (参照博文 ”Centos7 配置网络)
3. 关闭 selinux ,关闭iptables(两台机器都要操作)
//在Centos7 ,firewalld就是iptables
[root@slave ~]# setenforce 0
[root@slave ~]# vi /etc/selinux/config
[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
4. 关闭NetworkManager(两台机器都要操作)
[root@master ~]# systemctl stop NetworkManager
[root@master ~]# systemctl disable NetworkManager
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'
/* 定义密码 */
/* 在部署openstack过程 ,会有很多地方使用到密码 。
为了方便管理和安全,可以先定义好密码 ,利用mkpasswd生成随机字符串 */
(两台机器都安装)
[root@master ~]# yum install -y expect
[root@master ~]# mkpasswd -s 0 //生成随机字符串
/* 范本 */
Database password (no variable used) Root password for the database tn1Pi6Ytm
ADMIN_PASS Password of user admin 3qiVpzU2x
CEILOMETER_DBPASS Database password for the Telemetry service Czn3bF1hm
CEILOMETER_PASS Password of Telemetry service user ceilometer abquh12GU
CINDER_DBPASS Database password for the Block Storage service O3bwbpoZ3
CINDER_PASS Password of Block Storage service user cinder hf8LX9bow
DASH_DBPASS Database password for the dashboard 5qBZxnn1g
DEMO_PASS Password of user demo 9TtbgaA1q
GLANCE_DBPASS Database password for Image service Zznky4tP0
GLANCE_PASS Password of Image service user glance Wuyaf4cV6
HEAT_DBPASS Database password for the Orchestration service b7Fk5wjLg
HEAT_DOMAIN_PASS Password of Orchestration domain 7Gotb3eoH
HEAT_PASS Password of Orchestration service user heat eqQ2jLgz0
KEYSTONE_DBPASS Database password of Identity service f6zx0gURv
NEUTRON_DBPASS Database password for the Networking service quidyOC50
NEUTRON_PASS Password of Networking service user neutron mdcGVl29i
NOVA_DBPASS Database password for Compute service RYgv0rg7p
NOVA_PASS Password of Compute service user nova hsSNsqc43
RABBIT_PASS Password of user guest of RabbitMQ o3NXovnz5
SWIFT_PASS Password of Object Storage service user swift 6ci5xWOdk
METADATA_SECRET m8uhmQTu2
/* 设置主机名 */
1.两台机器,设置hostname
//方法
--〉1. hostname + 主机名
--〉2. vi /etc/hostname 让其永久生效
2. 编辑/etc/hosts
192.168.216.120 master
192.168.216.126 slave
/* 配置完后,
可以ping 一下hostname 看是否通 */
/* 同步时间 */
//master
[root@master ~]# yum install -y chrony
[root@master ~]# vi /etc/chrony.conf
//add or change
allow 192.168.216.0/24 //ip网段
[root@master ~]# systemctl enable chronyd.service
[root@master ~]# systemctl start chronyd.service
[root@master ~]# ps aux|grep chronyd
chrony 10140 0.2 0.0 98552 1300 ? S 15:07 0:00 /usr/sbin/chron yd
root 10148 0.0 0.0 112656 996 pts/0 S+ 15:07 0:00 grep --color=au to chronyd
//slave
[root@slave ~]# yum install -y chrony
[root@slave ~]# vi /etc/chrony.conf
//add or change,其他的解释掉
server master iburst //master为主名
[root@slave ~]# systemctl enable chronyd.service
[root@slave ~]# systemctl start chronyd.service
[root@slave ~]# ps aux|grep chronyd
chrony 10639 0.1 0.0 98552 1296 ? S 15:09 0:00 /usr/sbin/chron yd
root 10649 0.0 0.0 112656 996 pts/0 S+ 15:09 0:00 grep --color=au to chronyd