环境准备
1:主机名设置
hostnamectl set-hostname compute02
2:域名解析
[root@compute02 ~]# tail /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.100.201.201 controller01
10.100.214.202 compute01
10.100.214.203 compute02
3:配置yum源:
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum install centos-release-openstack-queens.noarch -y
4:下载libvirt插件
[root@compute02 yum.repos.d]# yum install libvirt -y
5:配置时间同步
[root@compute02 yum.repos.d]# yum install chrony -y
[root@compute02 yum.repos.d]# systemctl start chronyd
[root@compute02 yum.repos.d]# systemctl enable chronyd
[root@compute02 yum.repos.d]# systemctl status chronyd
6:安装openstack的客户端和openstack-selinux
[root@compute02 yum.repos.d]# yum install python-openstackclient openstack-selinux -y
配置计算服务
7:安装软件包
[root@compute02 ~]# yum install openstack-nova-compute -y
8:配置相关文件:(只需要将已经有的计算节点的配置文件更改)
[root@compute01 ~]# scp /etc/nova/nova.conf 10.100.214.203:/etc/nova/
修改/etc/nova/nova.conf的ip为自己本机的ip
9:启动服务
[root@compute02 ~]# systemctl start libvirtd.service openstack-nova-compute.service
[root@compute02 ~]# systemctl status libvirtd.service openstack-nova-compute.service
配置网络服务:
1:安装相关软件包:
[root@compute02 ~]# yum install -y openstack-neutron-linuxbridge ebtables ipset
2:network的相关配置
拷贝已有计算机点的配置文件:
[root@compute02 ~]# scp 10.100.214.202:/etc/neutron/neutron.conf /etc/neutron/
root@10.100.214.202's password:
neutron.conf 100% 72KB 16.2MB/s 00:00
[root@compute02 ~]# scp 10.100.214.202:/etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/
启动服务:
[root@compute02 ~]# systemctl enable neutron-linuxbridge-agent.service && systemctl start neutron-linuxbridge-agent.service
3:检测
[root@controller01 ~]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+--------------------+--------------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+--------------------------------------+--------------------+--------------+-------------------+-------+----------------+---------------------------+
| 0ed9a50d-d805-4cb4-bdb0-f09cb496af0b | Linux bridge agent | compute01 | | :-) | True | neutron-linuxbridge-agent |
| a36cf664-4476-4d81-99ad-1935e6bcc433 | Linux bridge agent | compute02 | | :-) | True | neutron-linuxbridge-agent |
| af066e09-2b33-4742-a342-917c0e55b4d3 | DHCP agent | controller01 | nova | :-) | True | neutron-dhcp-agent |
| cf9adb65-b6c4-4088-9d22-96967b4505c5 | Linux bridge agent | controller01 | | :-) | True | neutron-linuxbridge-agent |
| ee2e8e9a-4512-48e9-8dc2-e3f262f433bc | Metadata agent | controller01 | | :-) | True | neutron-metadata-agent |
+--------------------------------------+--------------------+--------------+-------------------+-------+----------------+------------