Centos8.3下用packstack安装四节点openstack-victoria版本
前言
victoria作为openstack2020年的最后一个稳定版本,现已支持packstack安装,本文将根据自身环境部署经验,分享部署过程。
环境准备
四台centos8.3的虚机或物理机,具体配置如下:
控制节点:至少需要6G内存(内存过小安装过程可能报错),至少100G硬盘,2张网卡
网络节点:至少4G内存,3张网卡
计算节点:内存和硬盘尽量大(可以多创虚机),dvr模式3张网卡,非dvr2张网卡
网段划分:管理网(enps3)可以联网,数据网(enp0s8)内部网络,br-ex网卡(不设置ip)
设置hostname
hostnamectl set-hostname controller
修改hosts文件
vim /etc/hosts
禁用NetworkManager并使用network-scripts配置网络
centos8默认使用NetworkManager管理网络,对于openstack来说仍然需要network-scripts配置网络
systemctl disable NetworkManager
systemctl stop NetworkManager
dnf install network-scripts -y
systemctl enable network
systemctl start network
vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
vim /etc/sysconfig/network-scripts/ifcfg-enp0s8
vim /etc/sysconfig/network-scripts/ifcfg-enp0s9
systemctl restart network
管理网和数据网不要在同一个网段,ip地址最好配成静态的,enp0s9设置成静态,不配置ip
禁用防火墙和SELINUX
systemctl disable firewalld
systemctl stop firewalld
setenforce 0
启用powertools
dnf update -y
dnf config-manager --enable powertools
启用OpenStack repositories并安装packstack
仅在控制节点执行
dnf install -y centos-release-openstack-victoria
dnf update -y
dnf install -y openstack-packstack
生成应答文件并根据需要修改
仅在控制节点执行
packstack --gen-answer-file openstack-victoria-20210101.txt
vim openstack-victoria-20210101.txt
v版本二层默认使用ovn,可以根据需要改成openvswitch,需要修改的地方大致如下:
CONFIG_DEFAULT_PASSWORD=
CONFIG_CONTROLLER_HOST=
CONFIG_COMPUTE_HOSTS=
CONFIG_NETWORK_HOSTS=
CONFIG_STORAGE_HOST=
CONFIG_SAHARA_HOST=
CONFIG_AMQP_HOST=
CONFIG_MARIADB_HOST=
CONFIG_KEYSTONE_LDAP_URL=
CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=geneve,flat,vlan,vxlan
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch(默认是ovn,根据需要修改)
CONFIG_NEUTRON_L2_AGENT=openvswitch
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=extnet:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:enp0s9
CONFIG_NEUTRON_OVS_TUNNEL_IF=enp0s8
CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS=
开始部署
仅在控制节点执行
packstack --answer-file=openstack-victoria-20210101.txt
根据提示输入各个节点的root账户密码
部署过程大概持续30分钟左右,主要取决于网速和硬件配置
中间可能会报错,检查一下网络配置以及内存是否够用,一般重新执行上面的命令即可
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Heat entries [ DONE ]
Preparing Heat CloudFormation API entries [ DONE ]
Preparing MongoDB entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Sahara entries [ DONE ]
Preparing Nagios server entries [ DONE ]
Preparing Nagios host entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 192.168.1.31_controller.pp
192.168.1.31_controller.pp: [ DONE ]
Applying 192.168.1.32_network.pp
192.168.1.32_network.pp: [ DONE ]
Applying 192.168.1.33_compute1.pp
192.168.1.33_compute.pp: [ DONE ]
Applying 192.168.1.34_compute2.pp
192.168.1.34_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
安装成功
添加sudoer权限
neutron privsep需要使用sudo权限,但刚安装完的环境默认没有配置。
四个节点均需执行
修改neutron.conf
vim /etc/neutron/neutron.conf
[privsep]
user = neutron
helper_command = sudo privsep-helper
vim /etc/sudoers.d/neutron
添加
neutron ALL = (root) NOPASSWD: ALL
最后重启neutron-openvswitch-agent(控制节点不用重启)
systemctl restart neutron-openvswitch-agent.service
访问horizon
最后在浏览器里输入控制节点的ip,就可以访问openstack的horizon界面了。
用户名和密码可以在控制节点的keystonerc_admin文件里查到,安装成功后会自动生成这个文件。
. keystonerc_admin可以使用openstack命令行。
来源:oschina
链接:https://my.oschina.net/u/4417652/blog/4922009