1-openstack(rocky)各节点环境部署

Environment
环境配置非常重要,我按照官方文档步骤来操作
0 Security
1 Host networking
2 NTP
3 Openstack packages
4 SQL database
5 Message queue
6 Memcached
7 Etcd

0、Security
openstack需要用到以下密码,使用以下命令用来生成随机密码
$ openssl rand -hex 10

Password name
Description

Database password (no variable used)
Root password for the database

ADMIN_PASS
Password of user admin

CINDER_DBPASS
Database password for the Block Storage service

CINDER_PASS
Password of Block Storage service user cinder

DASH_DBPASS
Database password for the Dashboard

DEMO_PASS
Password of user demo

GLANCE_DBPASS
Database password for Image service

GLANCE_PASS
Password of Image service user glance

KEYSTONE_DBPASS
Database password of Identity service

METADATA_SECRET
Secret for the metadata proxy

NEUTRON_DBPASS
Database password for the Networking service

NEUTRON_PASS
Password of Networking service user neutron

NOVA_DBPASS
Database password for Compute service

NOVA_PASS
Password of Compute service user nova

PLACEMENT_PASS
Password of the Placement service user placement

RABBIT_PASS
Password of RabbitMQ user openstack

关闭selinux,卸载firewalld 和 iptables
(我是自己使用的实验环境,各位根据自己的实际需求去更改)
关闭selinux

[[email protected] ~]

# grep -v “^#” /etc/selinux/config | grep -v “^$”
SELINUX=disabled
SELINUXTYPE=targeted

[[email protected] ~]

#

[[email protected] ~]

# for i in {101..107};do rsync –delete -r -v /etc/selinux/config 192.168.0.$i:/etc/selinux/config ;done
sending incremental file list
config

sent 636 bytes received 41 bytes 1,354.00 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 451.33 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 1,354.00 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 451.33 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 1,354.00 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 1,354.00 bytes/sec
total size is 542 speedup is 0.80
sending incremental file list
config

sent 636 bytes received 41 bytes 451.33 bytes/sec
total size is 542 speedup is 0.80

[[email protected] ~]

# rsync –delete -r -v /etc/selinux/config 192.168.0.9:/etc/selinux/config
sending incremental file list
config

sent 94 bytes received 41 bytes 270.00 bytes/sec
total size is 542 speedup is 4.01

卸载防火墙

[[email protected] ~]

# ansible all -m command -a ‘yum -y remove NetworkManager-* firewalld-* python-firewall’
[WARNING]: Consider using the yum module rather than running ‘yum’. If you need to use command because yum is insufficient you can add ‘warn:
false’ to this command task or set ‘command_warnings=False’ in ansible.cfg to get rid of this message.

compute2 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
–> Running transaction check
—> Package NetworkManager.x86_64 1:1.12.0-10.el7_6 will be erased
–> Processing Dependency: NetworkManager for package: cockpit-system-176-4.el7.centos.noarch
—> Package NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6 will be erased
—> Package NetworkManager-team.x86_64 1:1.12.0-10.el7_6 will be erased
—> Package NetworkManager-tui.x86_64 1:1.12.0-10.el7_6 will be erased
—> Package firewalld.noarch 0:0.5.3-5.el7 will be erased
—> Package firewalld-filesystem.noarch 0:0.5.3-5.el7 will be erased
—> Package python-firewall.noarch 0:0.5.3-5.el7 will be erased
–> Running transaction check
—> Package cockpit-system.noarch 0:176-4.el7.centos will be erased
–> Processing Dependency: cockpit-system for package: cockpit-176-4.el7.centos.x86_64
–> Running transaction check
—> Package cockpit.x86_64 0:176-4.el7.centos will be erased
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

Removing:
NetworkManager x86_64 1:1.12.0-10.el7_6 @updates 4.8 M
NetworkManager-libnm x86_64 1:1.12.0-10.el7_6 @updates 6.5 M
NetworkManager-team x86_64 1:1.12.0-10.el7_6 @updates 36 k
NetworkManager-tui x86_64 1:1.12.0-10.el7_6 @updates 260 k
firewalld noarch 0.5.3-5.el7 @anaconda 1.8 M
firewalld-filesystem noarch 0.5.3-5.el7 @anaconda 239
python-firewall noarch 0.5.3-5.el7 @anaconda 1.8 M
Removing for dependencies:
cockpit x86_64 176-4.el7.centos @extras 47 k
cockpit-system noarch 176-4.el7.centos @extras 1.2 M

Transaction Summary

Remove 7 Packages (+2 Dependent packages)

Installed size: 16 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : firewalld-0.5.3-5.el7.noarch 1/9
Erasing : 1:NetworkManager-tui-1.12.0-10.el7_6.x86_64 2/9
Erasing : cockpit-176-4.el7.centos.x86_64 3/9
Erasing : cockpit-system-176-4.el7.centos.noarch 4/9
Erasing : 1:NetworkManager-team-1.12.0-10.el7_6.x86_64 5/9
Erasing : firewalld-filesystem-0.5.3-5.el7.noarch 6/9
Erasing : python-firewall-0.5.3-5.el7.noarch 7/9
Erasing : 1:NetworkManager-1.12.0-10.el7_6.x86_64 8/9
Erasing : 1:NetworkManager-libnm-1.12.0-10.el7_6.x86_64 9/9
Verifying : 1:NetworkManager-libnm-1.12.0-10.el7_6.x86_64 1/9
Verifying : 1:NetworkManager-tui-1.12.0-10.el7_6.x86_64 2/9
Verifying : 1:NetworkManager-1.12.0-10.el7_6.x86_64 3/9
Verifying : cockpit-176-4.el7.centos.x86_64 4/9
Verifying : firewalld-0.5.3-5.el7.noarch 5/9
Verifying : cockpit-system-176-4.el7.centos.noarch 6/9
Verifying : 1:NetworkManager-team-1.12.0-10.el7_6.x86_64 7/9
Verifying : python-firewall-0.5.3-5.el7.noarch 8/9
Verifying : firewalld-filesystem-0.5.3-5.el7.noarch 9/9

Removed:
NetworkManager.x86_64 1:1.12.0-10.el7_6
NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6
NetworkManager-team.x86_64 1:1.12.0-10.el7_6
NetworkManager-tui.x86_64 1:1.12.0-10.el7_6
firewalld.noarch 0:0.5.3-5.el7
firewalld-filesystem.noarch 0:0.5.3-5.el7
python-firewall.noarch 0:0.5.3-5.el7

Dependency Removed:
cockpit.x86_64 0:176-4.el7.centos cockpit-system.noarch 0:176-4.el7.centos

Complete!


完成后重启所有节点

[[email protected] ~]

# ansible all -m command -a ‘reboot’
controller | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to controller closed.”,
“unreachable”: true
}
compute1 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute1 closed.”,
“unreachable”: true
}
compute2 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute2 closed.”,
“unreachable”: true
}
compute3 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute3 closed.”,
“unreachable”: true
}
compute5 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute5 closed.”,
“unreachable”: true
}
block1 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to block1 closed.”,
“unreachable”: true
}
compute4 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute4 closed.”,
“unreachable”: true
}
compute6 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute6 closed.”,
“unreachable”: true
}

1、Host networking
部署本地hosts,修改主机名(改主机名的我不贴代码了)

[[email protected] ~]

# for i in {101..107};do rsync –delete -r -v /etc/hosts 192.168.0.$i:/etc/hosts ;done
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 341.33 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 341.33 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74

[[email protected] ~]

# rsync –delete -r -v /etc/hosts 192.168.0.9:/etc/hosts
sending incremental file list
hosts

sent 471 bytes received 41 bytes 1,024.00 bytes/sec
total size is 378 speedup is 0.74
然后随便找个节点验证一下

[[email protected] ~]

# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.101 controller
192.168.0.102 compute1
192.168.0.103 compute2
192.168.0.104 compute3
192.168.0.105 compute4
192.168.0.106 compute5
192.168.0.107 compute6
192.168.0.9 block1
192.168.0.9 object1

2、Network Time Protocol (NTP)
部署NTP服务器
在controller节点

[[email protected] ~]

# grep -v ‘^#’ /etc/chrony.conf | grep -v ‘^$’
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
allow 192.168.0.0/24
logdir /var/log/chrony

[[email protected] ~]

#

在其余节点

[[email protected] ~]

# grep -v ‘^#’ /root/chrony.conf | grep -v ‘^$’
server controller iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony

[[email protected] ~]

# for i in {102..107};do rsync –delete -r -v /root/chrony.conf 192.168.0.$i:/etc/chrony.conf ;done
sending incremental file list
chrony.conf

sent 103 bytes received 47 bytes 300.00 bytes/sec
total size is 1,137 speedup is 7.58
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 586.00 bytes/sec
total size is 1,137 speedup is 1.29
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 1,758.00 bytes/sec
total size is 1,137 speedup is 1.29
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 251.14 bytes/sec
total size is 1,137 speedup is 1.29
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 586.00 bytes/sec
total size is 1,137 speedup is 1.29
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 1,758.00 bytes/sec
total size is 1,137 speedup is 1.29

[[email protected] ~]

# rsync –delete -r -v /root/chrony.conf 192.168.0.9:/etc/chrony.conf
sending incremental file list
chrony.conf

sent 832 bytes received 47 bytes 586.00 bytes/sec
total size is 1,137 speedup is 1.29

重启所有节点NTP服务,并设置为开机自启

[[email protected] ~]

# ansible all -m command -a ‘systemctl restart chronyd’
controller | CHANGED | rc=0 >>

compute1 | CHANGED | rc=0 >>

block1 | CHANGED | rc=0 >>

compute5 | CHANGED | rc=0 >>

compute3 | CHANGED | rc=0 >>

compute2 | CHANGED | rc=0 >>

compute4 | CHANGED | rc=0 >>

compute6 | CHANGED | rc=0 >>

[[email protected] ~]

# ansible all -m command -a ‘systemctl enable chronyd’
controller | CHANGED | rc=0 >>

compute3 | CHANGED | rc=0 >>

compute1 | CHANGED | rc=0 >>

compute2 | CHANGED | rc=0 >>

block1 | CHANGED | rc=0 >>

compute4 | CHANGED | rc=0 >>

compute6 | CHANGED | rc=0 >>

compute5 | CHANGED | rc=0 >>

完成后测试一下NTP是否正常

[[email protected] ~]

# ansible all -m command -a ‘chronyc sources’
controller | CHANGED | rc=0 >>
210 Number of sources = 4

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* 119.28.206.193 2 6 357 5 +195us[ -645us] +/- 62ms
^+ xk-6-95-a8.bta.net.cn 2 6 377 22 -2972us[-3766us] +/- 65ms
^- ntp-fi01.rserver.eu 2 6 267 18 +2980us[+2177us] +/- 149ms
^- 78-241-15-51.rev.cloud.s> 3 6 376 215 +1922us[-3600us] +/- 159ms

compute3 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 63 -1142us[ -584us] +/- 38ms

compute1 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 61 +547us[ +35us] +/- 38ms

compute2 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 60 +179us[ -266us] +/- 38ms

block1 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 21 +29us[ -231us] +/- 39ms

compute6 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 58 +31us[ -479us] +/- 38ms

compute5 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 60 -226us[-1338us] +/- 38ms

compute4 | CHANGED | rc=0 >>
210 Number of sources = 1

MS Name/IP address Stratum Poll Reach LastRx Last sample

^* controller 3 6 37 60 +456us[ -702us] +/- 38ms

3、OpenStack packages
注意,所有的节点都需要部署安装包,不同的版本安装不同的仓库,这里我们安装的是rocky版本
首先启用OpenStack repository

[[email protected] ~]

# ansible all -m yum -a ‘name=centos-release-openstack-rocky state=installed disable_gpg_check=yes’
compute3 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.xtom.com\n * epel: mirror.twinlakes.net\n * extras: mirror.sfo12.us.leaseweb.net\n * updates: mirror.hostduplex.com\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 34 kB/s | 30 kB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
compute1 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.xtom.com\n * epel: mirror.nodesdirect.com\n * extras: mirrors.xtom.com\n * updates: mirror.hostduplex.com\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 38 kB/s | 30 kB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
compute2 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.xtom.com\n * epel: mirrors.lug.mtu.edu\n * extras: mirror.sfo12.us.leaseweb.net\n * updates: mirror.hostduplex.com\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 32 kB/s | 30 kB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
controller | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirror.sjc02.svwh.net\n * epel: mirror.sjc02.svwh.net\n * extras: mirror.scalabledns.com\n * updates: mirror.sjc02.svwh.net\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 22 kB/s | 30 kB 00:01 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
compute4 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.xtom.com\n * epel: sjc.edge.kernel.org\n * extras: sjc.edge.kernel.org\n * updates: sjc.edge.kernel.org\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 37 kB/s | 30 kB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
compute6 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.usc.edu\n * epel: mirrors.sonic.net\n * extras: mirrors.usc.edu\n * updates: mirrors.usc.edu\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 33 kB/s | 30 kB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
compute5 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirrors.xtom.com\n * epel: sjc.edge.kernel.org\n * extras: mirrors.xtom.com\n * updates: sjc.edge.kernel.org\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 15 kB/s | 30 kB 00:02 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}
block1 | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: repos-lax.psychz.net\n * centos-sclo-rh: mirror.scalabledns.com\n * centos-sclo-sclo: repos-lax.psychz.net\n * epel: mirror.rnet.missouri.edu\n * extras: repos-lax.psychz.net\n * updates: mirror.hostduplex.com\n * webtatic: uk.repo.webtatic.com\nResolving Dependencies\n–> Running transaction check\n—> Package centos-release-openstack-rocky.noarch 0:1-1.el7.centos will be installed\n–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Processing Dependency: centos-release-ceph-luminous for package: centos-release-openstack-rocky-1-1.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos will be installed\n–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-luminous-1.1-2.el7.centos.noarch\n—> Package centos-release-qemu-ev.noarch 0:1.0-4.el7.centos will be installed\n–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-4.el7.centos.noarch\n–> Running transaction check\n—> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed\n—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository\n Size\n================================================================================\nInstalling:\n centos-release-openstack-rocky noarch 1-1.el7.centos extras 5.2 k\nInstalling for dependencies:\n centos-release-ceph-luminous noarch 1.1-2.el7.centos extras 4.4 k\n centos-release-qemu-ev noarch 1.0-4.el7.centos extras 11 k\n centos-release-storage-common noarch 2-2.el7.centos extras 5.1 k\n centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package (+4 Dependent packages)\n\nTotal download size: 30 k\nInstalled size: 24 k\nDownloading packages:\n——————————————————————————–\nTotal 30 kB/s | 30 kB 00:01 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : centos-release-storage-common-2-2.el7.centos.noarch 1/5 \n Installing : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Installing : centos-release-virt-common-1-1.el7.centos.noarch 3/5 \n Installing : centos-release-qemu-ev-1.0-4.el7.centos.noarch 4/5 \n Installing : centos-release-openstack-rocky-1-1.el7.centos.noarch 5/5 \n Verifying : centos-release-qemu-ev-1.0-4.el7.centos.noarch 1/5 \n Verifying : centos-release-ceph-luminous-1.1-2.el7.centos.noarch 2/5 \n Verifying : centos-release-openstack-rocky-1-1.el7.centos.noarch 3/5 \n Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5 \n Verifying : centos-release-storage-common-2-2.el7.centos.noarch 5/5 \n\nInstalled:\n centos-release-openstack-rocky.noarch 0:1-1.el7.centos \n\nDependency Installed:\n centos-release-ceph-luminous.noarch 0:1.1-2.el7.centos \n centos-release-qemu-ev.noarch 0:1.0-4.el7.centos \n centos-release-storage-common.noarch 0:2-2.el7.centos \n centos-release-virt-common.noarch 0:1-1.el7.centos \n\nComplete!\n”
]
}

注意,如果你使用的是RHEL,需要启用RDO repository

yum install https://rdoproject.org/repos/rdo-release.rpm

完成后更新系统

nsible all -m command -a ‘yum -y upgrade’

(输出太长懒得贴了)
(如果说更新的时候包含新的kenerl,那就重启一下来激活)

然后安装openstack客户端,没客户端你没法命令行操作

[[email protected] ~]

# ansible all -m yum -a ‘name=python-openstackclient state=installed disable_gpg_check=yes’

确认一下selinux是否关闭

[[email protected] ~]

# ansible all -m command -a ‘getenforce’
controller | CHANGED | rc=0 >>
Disabled

compute4 | CHANGED | rc=0 >>
Disabled

compute2 | CHANGED | rc=0 >>
Disabled

compute1 | CHANGED | rc=0 >>
Disabled

compute5 | CHANGED | rc=0 >>
Disabled

compute6 | CHANGED | rc=0 >>
Disabled

block1 | CHANGED | rc=0 >>
Disabled

compute3 | CHANGED | rc=0 >>
Disabled

如果你非得打开selinux,那你自己把openstack-selinux装上

yum install openstack-selinux

好了,包装完了,保险起见,重启一下吧

[[email protected] ~]

# ansible all -m command -a ‘reboot’
controller | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to controller closed.”,
“unreachable”: true
}
compute4 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute4 closed.”,
“unreachable”: true
}
compute6 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute6 closed.”,
“unreachable”: true
}
compute5 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute5 closed.”,
“unreachable”: true
}
compute2 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute2 closed.”,
“unreachable”: true
}
block1 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to block1 closed.”,
“unreachable”: true
}
compute1 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute1 closed.”,
“unreachable”: true
}
compute3 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Shared connection to compute3 closed.”,
“unreachable”: true
}

4、SQL database
安装mariadb数据库,然后配置一下

[[email protected] ~]

# ansible controller -m yum -a ‘name=mariadb,mariadb-server,python2-PyMySQL state=installed disable_gpg_check=yes’
controller | CHANGED => {
“ansible_facts”: {
“pkg_mgr”: “yum”
},
“changed”: true,
“msg”: “”,
“rc”: 0,
“results”: [
“Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirror.sjc02.svwh.net\n * centos-qemu-ev: mirror.scalabledns.com\n * epel: mirror.sjc02.svwh.net\n * extras: mirror.scalabledns.com\n * updates: mirror.sjc02.svwh.net\nResolving Dependencies\n–> Running transaction check\n—> Package mariadb.x86_64 3:10.1.20-2.el7 will be installed\n—> Package mariadb-server.x86_64 3:10.1.20-2.el7 will be installed\n–> Processing Dependency: mariadb-errmsg(x86-64) = 3:10.1.20-2.el7 for package: 3:mariadb-server-10.1.20-2.el7.x86_64\n–> Processing Dependency: socat for package: 3:mariadb-server-10.1.20-2.el7.x86_64\n–> Processing Dependency: perl(DBI) for package: 3:mariadb-server-10.1.20-2.el7.x86_64\n–> Processing Dependency: perl(DBD::mysql) for package: 3:mariadb-server-10.1.20-2.el7.x86_64\n—> Package python2-PyMySQL.noarch 0:0.9.2-2.el7 will be installed\n–> Running transaction check\n—> Package mariadb-errmsg.x86_64 3:10.1.20-2.el7 will be installed\n—> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed\n—> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed\n–> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64\n–> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64\n—> Package socat.x86_64 0:1.7.3.2-2.el7 will be installed\n–> Running transaction check\n—> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed\n–> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch\n–> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch\n–> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch\n–> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch\n–> Running transaction check\n—> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed\n–> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch\n–> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch\n—> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed\n–> Running transaction check\n—> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed\n—> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed\n–> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n mariadb x86_64 3:10.1.20-2.el7 centos-openstack-rocky 6.3 M\n mariadb-server x86_64 3:10.1.20-2.el7 centos-openstack-rocky 19 M\n python2-PyMySQL noarch 0.9.2-2.el7 centos-openstack-rocky 92 k\nInstalling for dependencies:\n mariadb-errmsg x86_64 3:10.1.20-2.el7 centos-openstack-rocky 200 k\n perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k\n perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k\n perl-DBD-MySQL x86_64 4.023-6.el7 base 140 k\n perl-DBI x86_64 1.627-4.el7 base 802 k\n perl-IO-Compress noarch 2.061-2.el7 base 260 k\n perl-Net-Daemon noarch 0.48-5.el7 base 51 k\n perl-PlRPC noarch 0.2020-14.el7 base 36 k\n socat x86_64 1.7.3.2-2.el7 base 290 k\n\nTransaction Summary\n================================================================================\nInstall 3 Packages (+9 Dependent packages)\n\nTotal download size: 27 M\nInstalled size: 139 M\nDownloading packages:\n——————————————————————————–\nTotal 5.1 MB/s | 27 MB 00:05 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : 3:mariadb-10.1.20-2.el7.x86_64 1/12 \n Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 2/12 \n Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 3/12 \n Installing : perl-IO-Compress-2.061-2.el7.noarch 4/12 \n Installing : perl-Net-Daemon-0.48-5.el7.noarch 5/12 \n Installing : perl-PlRPC-0.2020-14.el7.noarch 6/12 \n Installing : perl-DBI-1.627-4.el7.x86_64 7/12 \n Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 8/12 \n Installing : socat-1.7.3.2-2.el7.x86_64 9/12 \n Installing : 3:mariadb-errmsg-10.1.20-2.el7.x86_64 10/12 \n Installing : 3:mariadb-server-10.1.20-2.el7.x86_64 11/12 \n Installing : python2-PyMySQL-0.9.2-2.el7.noarch 12/12 \n Verifying : 3:mariadb-errmsg-10.1.20-2.el7.x86_64 1/12 \n Verifying : socat-1.7.3.2-2.el7.x86_64 2/12 \n Verifying : perl-Net-Daemon-0.48-5.el7.noarch 3/12 \n Verifying : 3:mariadb-server-10.1.20-2.el7.x86_64 4/12 \n Verifying : perl-DBD-MySQL-4.023-6.el7.x86_64 5/12 \n Verifying : perl-PlRPC-0.2020-14.el7.noarch 6/12 \n Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 7/12 \n Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 8/12 \n Verifying : perl-DBI-1.627-4.el7.x86_64 9/12 \n Verifying : python2-PyMySQL-0.9.2-2.el7.noarch 10/12 \n Verifying : 3:mariadb-10.1.20-2.el7.x86_64 11/12 \n Verifying : perl-IO-Compress-2.061-2.el7.noarch 12/12 \n\nInstalled:\n mariadb.x86_64 3:10.1.20-2.el7 mariadb-server.x86_64 3:10.1.20-2.el7 \n python2-PyMySQL.noarch 0:0.9.2-2.el7 \n\nDependency Installed:\n mariadb-errmsg.x86_64 3:10.1.20-2.el7 \n perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 \n perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 \n perl-DBD-MySQL.x86_64 0:4.023-6.el7 \n perl-DBI.x86_64 0:1.627-4.el7 \n perl-IO-Compress.noarch 0:2.061-2.el7 \n perl-Net-Daemon.noarch 0:0.48-5.el7 \n perl-PlRPC.noarch 0:0.2020-14.el7 \n socat.x86_64 0:1.7.3.2-2.el7 \n\nComplete!\n”
]
}

现在我们去controller操作

[[email protected] ~]

# vim /etc/my.cnf.d/openstack.cnf
新添加一个openstack.cnf的配置文件

[[email protected] ~]

# cat /etc/my.cnf.d/openstack.cnf

[mysqld]

bind-address = 192.168.0.101

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

[[email protected] ~]

# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

[[email protected] ~]

# systemctl start mariadb.service

[[email protected] ~]

# systemctl status mariadb.service
● mariadb.service – MariaDB 10.1 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-04-14 00:00:40 EDT; 12s ago
Process: 6158 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 5973 ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Process: 5948 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 6131 (mysqld)
Status: “Taking your SQL requests now…”
Tasks: 26
CGroup: /system.slice/mariadb.service
└─6131 /usr/libexec/mysqld –basedir=/usr

Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: See the MariaDB Knowledgebase at http://mariadb.com/kb or the
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: MySQL manual for more instructions.
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: Please report any problems at http://mariadb.org/jira
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: The latest information about MariaDB is available at http://mariadb.org/.
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: You can find additional information about the MySQL part at:
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: http://dev.mysql.com
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: Consider joining MariaDB’s strong and vibrant community:
Apr 14 00:00:39 controller mysql-prepare-db-dir[5973]: https://mariadb.org/get-involved/
Apr 14 00:00:39 controller mysqld[6131]: 2019-04-14 0:00:39 140632395487424 [Note] /usr/libexec/mysqld (mysqld 10.1.20-MariaDB) starting …6131 …
Apr 14 00:00:40 controller systemd[1]: Started MariaDB 10.1 database server.
Hint: Some lines were ellipsized, use -l to show in full.
启动服务后确认端口号

[[email protected] ~]

# netstat -antup | grep mysqld
tcp 0 0 192.168.0.101:3306 0.0.0.0:* LISTEN 6131/mysqld
初始化数据库,密码自己设,我是123456,然后记下来别忘了

[[email protected] ~]

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y

  • Dropping test database…
    … Success!
  • Removing privileges on test database…
    … Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

5、Message queue
Openstack需要使用消息队列来沟通协调操作信息和状态信息。一般来说消息队列安装在控制节点。Openstack本身支持很多种消息队列,比如说 RabbitMQ, Qpid, ZeroMQ等等。但是在大多数的分布式部署中,OpenStack使用RabbitMQ来作为消息队列,因为大部分的分布式集群都支持这种消息队列服务。如果你要安装别的,那请也可以。

[[email protected] ~]

# yum install rabbitmq-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirror.sjc02.svwh.net
  • centos-qemu-ev: mirror.scalabledns.com
  • epel: mirror.sjc02.svwh.net
  • extras: mirror.scalabledns.com
  • updates: mirror.sjc02.svwh.net
    Resolving Dependencies
    –> Running transaction check
    —> Package rabbitmq-server.noarch 0:3.6.16-1.el7 will be installed
    –> Processing Dependency: erlang-xmerl >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-tools >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-stdlib >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-ssl >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-sasl >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-public_key >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-os_mon >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-mnesia >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-kernel >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-erts >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-eldap >= 18 for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Processing Dependency: erlang-sd_notify for package: rabbitmq-server-3.6.16-1.el7.noarch
    –> Running transaction check
    —> Package erlang-eldap.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-asn1(x86-64) = 19.3.6.4-1.el7 for package: erlang-eldap-19.3.6.4-1.el7.x86_64
    —> Package erlang-erts.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: lksctp-tools for package: erlang-erts-19.3.6.4-1.el7.x86_64
    —> Package erlang-kernel.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-mnesia.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-os_mon.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-snmp(x86-64) = 19.3.6.4-1.el7 for package: erlang-os_mon-19.3.6.4-1.el7.x86_64
    –> Processing Dependency: erlang-otp_mibs(x86-64) = 19.3.6.4-1.el7 for package: erlang-os_mon-19.3.6.4-1.el7.x86_64
    —> Package erlang-public_key.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-crypto(x86-64) = 19.3.6.4-1.el7 for package: erlang-public_key-19.3.6.4-1.el7.x86_64
    —> Package erlang-sasl.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-sd_notify.x86_64 0:1.0-2.el7 will be installed
    —> Package erlang-ssl.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-inets(x86-64) = 19.3.6.4-1.el7 for package: erlang-ssl-19.3.6.4-1.el7.x86_64
    —> Package erlang-stdlib.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-compiler(x86-64) = 19.3.6.4-1.el7 for package: erlang-stdlib-19.3.6.4-1.el7.x86_64
    —> Package erlang-tools.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-runtime_tools(x86-64) = 19.3.6.4-1.el7 for package: erlang-tools-19.3.6.4-1.el7.x86_64
    —> Package erlang-xmerl.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Running transaction check
    —> Package erlang-asn1.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-compiler.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-hipe(x86-64) = 19.3.6.4-1.el7 for package: erlang-compiler-19.3.6.4-1.el7.x86_64
    —> Package erlang-crypto.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-inets.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-otp_mibs.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-runtime_tools.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package erlang-snmp.x86_64 0:19.3.6.4-1.el7 will be installed
    —> Package lksctp-tools.x86_64 0:1.0.17-2.el7 will be installed
    –> Running transaction check
    —> Package erlang-hipe.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Processing Dependency: erlang-syntax_tools(x86-64) = 19.3.6.4-1.el7 for package: erlang-hipe-19.3.6.4-1.el7.x86_64
    –> Running transaction check
    —> Package erlang-syntax_tools.x86_64 0:19.3.6.4-1.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================

Package Arch Version Repository Size

Installing:
rabbitmq-server noarch 3.6.16-1.el7 centos-openstack-rocky 4.6 M
Installing for dependencies:
erlang-asn1 x86_64 19.3.6.4-1.el7 centos-openstack-rocky 737 k
erlang-compiler x86_64 19.3.6.4-1.el7 centos-openstack-rocky 1.1 M
erlang-crypto x86_64 19.3.6.4-1.el7 centos-openstack-rocky 122 k
erlang-eldap x86_64 19.3.6.4-1.el7 centos-openstack-rocky 120 k
erlang-erts x86_64 19.3.6.4-1.el7 centos-openstack-rocky 3.0 M
erlang-hipe x86_64 19.3.6.4-1.el7 centos-openstack-rocky 2.6 M
erlang-inets x86_64 19.3.6.4-1.el7 centos-openstack-rocky 766 k
erlang-kernel x86_64 19.3.6.4-1.el7 centos-openstack-rocky 1.1 M
erlang-mnesia x86_64 19.3.6.4-1.el7 centos-openstack-rocky 769 k
erlang-os_mon x86_64 19.3.6.4-1.el7 centos-openstack-rocky 118 k
erlang-otp_mibs x86_64 19.3.6.4-1.el7 centos-openstack-rocky 37 k
erlang-public_key x86_64 19.3.6.4-1.el7 centos-openstack-rocky 585 k
erlang-runtime_tools x86_64 19.3.6.4-1.el7 centos-openstack-rocky 214 k
erlang-sasl x86_64 19.3.6.4-1.el7 centos-openstack-rocky 293 k
erlang-sd_notify x86_64 1.0-2.el7 centos-openstack-rocky 9.9 k
erlang-snmp x86_64 19.3.6.4-1.el7 centos-openstack-rocky 1.6 M
erlang-ssl x86_64 19.3.6.4-1.el7 centos-openstack-rocky 788 k
erlang-stdlib x86_64 19.3.6.4-1.el7 centos-openstack-rocky 2.4 M
erlang-syntax_tools x86_64 19.3.6.4-1.el7 centos-openstack-rocky 408 k
erlang-tools x86_64 19.3.6.4-1.el7 centos-openstack-rocky 567 k
erlang-xmerl x86_64 19.3.6.4-1.el7 centos-openstack-rocky 1.0 M
lksctp-tools x86_64 1.0.17-2.el7 base 88 k

Transaction Summary

Install 1 Package (+22 Dependent packages)

Total download size: 23 M
Installed size: 40 M
Is this ok [y/d/N]: y
Downloading packages:
(1/23): erlang-compiler-19.3.6.4-1.el7.x86_64.rpm | 1.1 MB 00:00:01
(2/23): erlang-asn1-19.3.6.4-1.el7.x86_64.rpm | 737 kB 00:00:01
(3/23): erlang-crypto-19.3.6.4-1.el7.x86_64.rpm | 122 kB 00:00:00
(4/23): erlang-eldap-19.3.6.4-1.el7.x86_64.rpm | 120 kB 00:00:00
(5/23): erlang-erts-19.3.6.4-1.el7.x86_64.rpm | 3.0 MB 00:00:00
(6/23): erlang-inets-19.3.6.4-1.el7.x86_64.rpm | 766 kB 00:00:00
(7/23): erlang-hipe-19.3.6.4-1.el7.x86_64.rpm | 2.6 MB 00:00:00
(8/23): erlang-kernel-19.3.6.4-1.el7.x86_64.rpm | 1.1 MB 00:00:00
(9/23): erlang-os_mon-19.3.6.4-1.el7.x86_64.rpm | 118 kB 00:00:00
(10/23): erlang-mnesia-19.3.6.4-1.el7.x86_64.rpm | 769 kB 00:00:00
(11/23): erlang-public_key-19.3.6.4-1.el7.x86_64.rpm | 585 kB 00:00:00
(12/23): erlang-otp_mibs-19.3.6.4-1.el7.x86_64.rpm | 37 kB 00:00:00
(13/23): erlang-runtime_tools-19.3.6.4-1.el7.x86_64.rpm | 214 kB 00:00:00
(14/23): erlang-sasl-19.3.6.4-1.el7.x86_64.rpm | 293 kB 00:00:00
(15/23): erlang-sd_notify-1.0-2.el7.x86_64.rpm | 9.9 kB 00:00:00
(16/23): erlang-snmp-19.3.6.4-1.el7.x86_64.rpm | 1.6 MB 00:00:00
(17/23): erlang-ssl-19.3.6.4-1.el7.x86_64.rpm | 788 kB 00:00:00
(18/23): erlang-stdlib-19.3.6.4-1.el7.x86_64.rpm | 2.4 MB 00:00:00
(19/23): erlang-syntax_tools-19.3.6.4-1.el7.x86_64.rpm | 408 kB 00:00:00
(20/23): erlang-xmerl-19.3.6.4-1.el7.x86_64.rpm | 1.0 MB 00:00:00
(21/23): erlang-tools-19.3.6.4-1.el7.x86_64.rpm | 567 kB 00:00:00
(22/23): lksctp-tools-1.0.17-2.el7.x86_64.rpm | 88 kB 00:00:01

(23/23): rabbitmq-server-3.6.16-1.el7.noarch.rpm | 4.6 MB 00:00:00

Total 3.5 MB/s | 23 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lksctp-tools-1.0.17-2.el7.x86_64 1/23
Installing : erlang-syntax_tools-19.3.6.4-1.el7.x86_64 2/23
Installing : erlang-hipe-19.3.6.4-1.el7.x86_64 3/23
Installing : erlang-compiler-19.3.6.4-1.el7.x86_64 4/23
Installing : erlang-crypto-19.3.6.4-1.el7.x86_64 5/23
Installing : erlang-stdlib-19.3.6.4-1.el7.x86_64 6/23
Installing : erlang-erts-19.3.6.4-1.el7.x86_64 7/23
Installing : erlang-kernel-19.3.6.4-1.el7.x86_64 8/23
Installing : erlang-mnesia-19.3.6.4-1.el7.x86_64 9/23
Installing : erlang-runtime_tools-19.3.6.4-1.el7.x86_64 10/23
Installing : erlang-snmp-19.3.6.4-1.el7.x86_64 11/23
Installing : erlang-asn1-19.3.6.4-1.el7.x86_64 12/23
Installing : erlang-public_key-19.3.6.4-1.el7.x86_64 13/23
Installing : erlang-inets-19.3.6.4-1.el7.x86_64 14/23
Installing : erlang-ssl-19.3.6.4-1.el7.x86_64 15/23
Installing : erlang-tools-19.3.6.4-1.el7.x86_64 16/23
Installing : erlang-sasl-19.3.6.4-1.el7.x86_64 17/23
Installing : erlang-eldap-19.3.6.4-1.el7.x86_64 18/23
Installing : erlang-otp_mibs-19.3.6.4-1.el7.x86_64 19/23
Installing : erlang-os_mon-19.3.6.4-1.el7.x86_64 20/23
Installing : erlang-xmerl-19.3.6.4-1.el7.x86_64 21/23
Installing : erlang-sd_notify-1.0-2.el7.x86_64 22/23
Installing : rabbitmq-server-3.6.16-1.el7.noarch 23/23
Verifying : erlang-snmp-19.3.6.4-1.el7.x86_64 1/23
Verifying : erlang-kernel-19.3.6.4-1.el7.x86_64 2/23
Verifying : erlang-otp_mibs-19.3.6.4-1.el7.x86_64 3/23
Verifying : erlang-xmerl-19.3.6.4-1.el7.x86_64 4/23
Verifying : erlang-mnesia-19.3.6.4-1.el7.x86_64 5/23
Verifying : erlang-runtime_tools-19.3.6.4-1.el7.x86_64 6/23
Verifying : erlang-syntax_tools-19.3.6.4-1.el7.x86_64 7/23
Verifying : erlang-asn1-19.3.6.4-1.el7.x86_64 8/23
Verifying : erlang-tools-19.3.6.4-1.el7.x86_64 9/23
Verifying : erlang-eldap-19.3.6.4-1.el7.x86_64 10/23
Verifying : lksctp-tools-1.0.17-2.el7.x86_64 11/23
Verifying : erlang-os_mon-19.3.6.4-1.el7.x86_64 12/23
Verifying : erlang-sd_notify-1.0-2.el7.x86_64 13/23
Verifying : erlang-public_key-19.3.6.4-1.el7.x86_64 14/23
Verifying : erlang-inets-19.3.6.4-1.el7.x86_64 15/23
Verifying : erlang-hipe-19.3.6.4-1.el7.x86_64 16/23
Verifying : erlang-compiler-19.3.6.4-1.el7.x86_64 17/23
Verifying : erlang-crypto-19.3.6.4-1.el7.x86_64 18/23
Verifying : erlang-stdlib-19.3.6.4-1.el7.x86_64 19/23
Verifying : rabbitmq-server-3.6.16-1.el7.noarch 20/23
Verifying : erlang-erts-19.3.6.4-1.el7.x86_64 21/23
Verifying : erlang-sasl-19.3.6.4-1.el7.x86_64 22/23
Verifying : erlang-ssl-19.3.6.4-1.el7.x86_64 23/23

Installed:
rabbitmq-server.noarch 0:3.6.16-1.el7

Dependency Installed:
erlang-asn1.x86_64 0:19.3.6.4-1.el7 erlang-compiler.x86_64 0:19.3.6.4-1.el7 erlang-crypto.x86_64 0:19.3.6.4-1.el7
erlang-eldap.x86_64 0:19.3.6.4-1.el7 erlang-erts.x86_64 0:19.3.6.4-1.el7 erlang-hipe.x86_64 0:19.3.6.4-1.el7
erlang-inets.x86_64 0:19.3.6.4-1.el7 erlang-kernel.x86_64 0:19.3.6.4-1.el7 erlang-mnesia.x86_64 0:19.3.6.4-1.el7
erlang-os_mon.x86_64 0:19.3.6.4-1.el7 erlang-otp_mibs.x86_64 0:19.3.6.4-1.el7 erlang-public_key.x86_64 0:19.3.6.4-1.el7
erlang-runtime_tools.x86_64 0:19.3.6.4-1.el7 erlang-sasl.x86_64 0:19.3.6.4-1.el7 erlang-sd_notify.x86_64 0:1.0-2.el7
erlang-snmp.x86_64 0:19.3.6.4-1.el7 erlang-ssl.x86_64 0:19.3.6.4-1.el7 erlang-stdlib.x86_64 0:19.3.6.4-1.el7
erlang-syntax_tools.x86_64 0:19.3.6.4-1.el7 erlang-tools.x86_64 0:19.3.6.4-1.el7 erlang-xmerl.x86_64 0:19.3.6.4-1.el7
lksctp-tools.x86_64 0:1.0.17-2.el7

Complete!

[[email protected] ~]

# systemctl enable rabbitmq-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.

[[email protected] ~]

# systemctl start rabbitmq-server.service

[[email protected] ~]

# systemctl status rabbitmq-server.service
● rabbitmq-server.service – RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-04-14 00:05:35 EDT; 1min 20s ago
Main PID: 6392 (beam.smp)
Status: “Initialized”
Tasks: 75
CGroup: /system.slice/rabbitmq-server.service
├─6392 /usr/lib64/erlang/erts-8.3.5.3/bin/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -K true — -root /usr/lib64/…
├─6589 erl_child_setup 1024
├─6603 inet_gethost 4
└─6604 inet_gethost 4

Apr 14 00:05:32 controller systemd[1]: Starting RabbitMQ broker…
Apr 14 00:05:33 controller rabbitmq-server[6392]: RabbitMQ 3.6.16. Copyright (C) 2007-2018 Pivotal Software, Inc.
Apr 14 00:05:33 controller rabbitmq-server[6392]: ## ## Licensed under the MPL. See http://www.rabbitmq.com/
Apr 14 00:05:33 controller rabbitmq-server[6392]: ## ##
Apr 14 00:05:33 controller rabbitmq-server[6392]: ########## Logs: /var/log/rabbitmq/[email protected]
Apr 14 00:05:33 controller rabbitmq-server[6392]: ###### ## /var/log/rabbitmq/[email protected]
Apr 14 00:05:33 controller rabbitmq-server[6392]: ##########
Apr 14 00:05:33 controller rabbitmq-server[6392]: Starting broker…
Apr 14 00:05:35 controller systemd[1]: Started RabbitMQ broker.
Apr 14 00:05:35 controller rabbitmq-server[6392]: completed with 0 plugins.

安装完成后添加用户,并授权,这里123456是我自己设置的密码。

[[email protected] ~]

# rabbitmqctl add_user openstack 123456
Creating user “openstack”

[[email protected] ~]

# rabbitmqctl set_permissions openstack “.” “.” “.*”
Setting permissions for user “openstack” in vhost “/”

[[email protected] ~]

#

6、Memcached
各个服务所使用的认证机制,都需要使用Memcached来存储令牌token。一般来说,Memcached服务安装在控制节点。因为涉及到令牌,所以在生产环境中,我们强烈建议同时启用防火墙、认证还有授权的方法来保证服务的安全。

[[email protected] ~]

# yum install memcached python-memcached
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirror.sjc02.svwh.net
  • centos-qemu-ev: mirror.scalabledns.com
  • epel: mirror.sjc02.svwh.net
  • extras: mirror.scalabledns.com
  • updates: mirror.sjc02.svwh.net
    Resolving Dependencies
    –> Running transaction check
    —> Package memcached.x86_64 0:1.5.6-1.el7 will be installed
    —> Package python-memcached.noarch 0:1.58-1.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================

Package Arch Version Repository Size

Installing:
memcached x86_64 1.5.6-1.el7 centos-openstack-rocky 124 k
python-memcached noarch 1.58-1.el7 centos-openstack-rocky 38 k

Transaction Summary

Install 2 Packages

Total download size: 162 k
Installed size: 391 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): python-memcached-1.58-1.el7.noarch.rpm | 38 kB 00:00:01

(2/2): memcached-1.5.6-1.el7.x86_64.rpm | 124 kB 00:00:01

Total 107 kB/s | 162 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : memcached-1.5.6-1.el7.x86_64 1/2
Installing : python-memcached-1.58-1.el7.noarch 2/2
Verifying : python-memcached-1.58-1.el7.noarch 1/2
Verifying : memcached-1.5.6-1.el7.x86_64 2/2

Installed:
memcached.x86_64 0:1.5.6-1.el7 python-memcached.noarch 0:1.58-1.el7

Complete!

[[email protected] ~]

#

[[email protected] ~]

# vim /etc/sysconfig/memcached

[[email protected] ~]

# cat /etc/sysconfig/memcached
PORT=”11211″
USER=”memcached”
MAXCONN=”1024″
CACHESIZE=”64″
OPTIONS=”-l 127.0.0.1,::1,controller”

[[email protected] ~]

# systemctl enable memcached
Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service to /usr/lib/systemd/system/memcached.service.

[[email protected] ~]

# systemctl start memcached

老规矩,装完了,验证一下

[[email protected] ~]

# systemctl status memcached
● memcached.service – memcached daemon
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-04-14 00:26:22 EDT; 6s ago
Main PID: 7870 (memcached)
Tasks: 10
CGroup: /system.slice/memcached.service
└─7870 /usr/bin/memcached -p 11211 -u memcached -m 64 -c 1024 -l 127.0.0.1,::1,controller

Apr 14 00:26:22 controller systemd[1]: Started memcached daemon.

[[email protected] ~]

# ss -antup | grep memcached
tcp LISTEN 0 128 192.168.0.101:11211 : users:((“memcached”,pid=7870,fd=28))
tcp LISTEN 0 128 127.0.0.1:11211 : users:((“memcached”,pid=7870,fd=26))
tcp LISTEN 0 128 ::1:11211 :::* users:((“memcached”,pid=7870,fd=27))

[[email protected] ~]

#

Etcd
在Openstack服务中,需要使用Etcd-这种可靠的分布式键-值存储-来锁定、保存各种配置信息,用来追踪各个服务的存活状态以及其它方面的信息。
这个服务需要安装在控制节点。

[[email protected] ~]

# yum install etcd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirror.sjc02.svwh.net
  • centos-qemu-ev: mirror.scalabledns.com
  • epel: muug.ca
  • extras: mirror.scalabledns.com
  • updates: mirror.sjc02.svwh.net
    Resolving Dependencies
    –> Running transaction check
    —> Package etcd.x86_64 0:3.3.11-2.el7.centos will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================

Package Arch Version Repository Size

Installing:
etcd x86_64 3.3.11-2.el7.centos extras 10 M

Transaction Summary

Install 1 Package

Total download size: 10 M
Installed size: 45 M
Is this ok [y/d/N]: y
Downloading packages:
etcd-3.3.11-2.el7.centos.x86_64.rpm | 10 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : etcd-3.3.11-2.el7.centos.x86_64 1/1
Verifying : etcd-3.3.11-2.el7.centos.x86_64 1/1

Installed:
etcd.x86_64 0:3.3.11-2.el7.centos

Complete!

[[email protected] ~]

#

[[email protected] ~]

# vim /etc/etcd/etcd.conf

[[email protected] ~]

# grep -v “^#” /etc/etcd/etcd.conf | grep -v “^$”

[Member]

ETCD_DATA_DIR=”/var/lib/etcd/default.etcd”
ETCD_LISTEN_PEER_URLS=”http://192.168.0.101:2380″
ETCD_LISTEN_CLIENT_URLS=”http://192.168.0.101:2379″
ETCD_NAME=”controller”

[Clustering]

ETCD_INITIAL_ADVERTISE_PEER_URLS=”http://192.168.0.101:2380″
ETCD_ADVERTISE_CLIENT_URLS=”http://192.168.0.101:2379″
ETCD_INITIAL_CLUSTER=”controller=http://192.168.0.101:2380″
ETCD_INITIAL_CLUSTER_TOKEN=”etcd-cluster-01″
ETCD_INITIAL_CLUSTER_STATE=”new”

[[email protected] ~]

#

启动etcd服务

[[email protected] ~]

# systemctl enable etcd
Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /usr/lib/systemd/system/etcd.service.

[[email protected] ~]

# systemctl start etcd

完成后检查服务状态

[[email protected] ~]

# systemctl status etcd
● etcd.service – Etcd Server
Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-04-14 00:43:54 EDT; 37s ago
Main PID: 8769 (etcd)
Tasks: 15
CGroup: /system.slice/etcd.service
└─8769 /usr/bin/etcd –name=controller –data-dir=/var/lib/etcd/default.etcd –listen-client-urls=http://192.168.0.101:2379

Apr 14 00:43:54 controller etcd[8769]: 2a53d62b094cc955 received MsgVoteResp from 2a53d62b094cc955 at term 2
Apr 14 00:43:54 controller etcd[8769]: 2a53d62b094cc955 became leader at term 2
Apr 14 00:43:54 controller etcd[8769]: raft.node: 2a53d62b094cc955 elected leader 2a53d62b094cc955 at term 2
Apr 14 00:43:54 controller etcd[8769]: setting up the initial cluster version to 3.3
Apr 14 00:43:54 controller etcd[8769]: set the initial cluster version to 3.3
Apr 14 00:43:54 controller etcd[8769]: enabled capabilities for version 3.3
Apr 14 00:43:54 controller etcd[8769]: ready to serve client requests
Apr 14 00:43:54 controller etcd[8769]: published {Name:controller ClientURLs:[http://192.168.0.101:2379]} to cluster 2ad6e94fd98cfd9f
Apr 14 00:43:54 controller systemd[1]: Started Etcd Server.
Apr 14 00:43:54 controller etcd[8769]: serving insecure client requests on 192.168.0.101:2379, this is strongly discouraged!

[[email protected] ~]

# ss -antup | grep etcd
tcp LISTEN 0 128 192.168.0.101:2379 : users:((“etcd”,pid=8769,fd=6))
tcp LISTEN 0 128 192.168.0.101:2380 : users:((“etcd”,pid=8769,fd=5))
tcp ESTAB 0 0 192.168.0.101:41262 192.168.0.101:2379 users:((“etcd”,pid=8769,fd=10))
tcp ESTAB 0 0 192.168.0.101:2379 192.168.0.101:41262 users:((“etcd”,pid=8769,fd=12))

此条目发表在OpenStack分类目录,贴了标签。将固定链接加入收藏夹。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注