增加一个计算节点
1. 克隆一台 compute1
my_ip: 10.0.0.32
注意: 一定要打开虚拟化
2. 修改主机名
hostnamectl set-hostname compute1
3. hosts解析 所有节点
10.0.0.11 controller
10.0.0.31 compute
10.0.0.32 compute1
scp /etc/hosts 10.0.0.31:/etc/hosts
scp /etc/hosts 10.0.0.32:/etc/hosts
4 . 配置yum源
-
拉取软件包, 并将其 解压到 /opt 目录下
curl -O http://10.0.0.98/openstack/openstack_rpm.tar.gz
tar zxvf openstack_rpm.tar.gz -C /opt/
-
配置yum源
scp 10.0.0.11:/etc/yum.repos.d/local.repo /etc/yum.repos.d/local.repo
# 检测
yum clean all; yum repolist
……
repo id repo name status
local local 3,894
openstack openstack 598
5.时间同步
# 安装软件包
yum -y install chrony.x86_64
# 修改配置
vim /etc/chrony.conf
……
server 10.0.0.11 iburst
# 重启服务
systemctl restart chronyd
systemctl enable chronyd
6. 安装 openstack 软件包
yum install python-openstackclient openstack-selinux -y
7.安装nova服务
# 安装软件包
yum install openstack-nova-compute -y
# 修改配置文件
cp /etc/nova/nova.conf{,.bak}
egrep -v '^$|#' /etc/nova/nova.conf.bak > /etc/nova/nova.conf # 备份文件
vim /etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.0.0.32
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
……
[glance]
api_servers = http://controller:9292
……
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = NOVA_PASS
……
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
……
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
……
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
……
检验
md5sum /etc/nova/nova.conf
0120e3244ca775c740ea4f445a079a0b /etc/nova/nova.conf
8.安装neutron服务
# 安装软件包
yum install openstack-neutron-linuxbridge ebtables ipset -y
# 备份文件
cp /etc/neutron/neutron.conf{,.bak}
egrep -v '^$|#' /etc/neutron/neutron.conf.bak > /etc/neutron/neutron.conf
# 修改配置
cat /etc/neutron/neutron.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
……
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = NEUTRON_PASS
……
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
……
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
……
# 检测
md5sum /etc/neutron/neutron.conf
77ffab503797be5063c06e8b956d6ed0 /etc/neutron/neutron.conf
9.配置Linuxbridge代理
# 备份文件
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,.bak}
egrep -v '^$|#' /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak > /etc/neutron/plugins/ml2/linuxbridge_agent.ini
# 修改 配置文件
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
……
[linux_bridge]
physical_interface_mappings = provider:eth0
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = False
# 检测
md5sum /etc/neutron/plugins/ml2/linuxbridge_agent.ini
3f474907a7f438b34563e4d3f3c29538 /etc/neutron/plugins/ml2/linuxbridge_agent.ini
10.为 nova 配置网络服务
# 修改配置
vim /etc/nova/nova.conf
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
# 检验
md5sum /etc/nova/nova.conf
517ca200ff4640b2c7aa257024f571d7 /etc/nova/nova.conf
11.重启服务
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
# 检测
neutron agent-list
排错
-
报错信息
tail -f /var/log/nova/nova-novncproxy.log
……
2022-09-15 09:59:29.776 21073 INFO nova.console.websocketproxy …… on: [Errno 113] EHOSTUNREACH
-
检查配置文件
-
检查防火墙
systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2022-09-15 09:41:04 CST; 22min ago
Docs: man:firewalld(1)
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
关闭 selinux
vim /etc/selinux/config
……
SELINUX=disabled
-
重启服务
systemctl restart openstack-nova-compute.service