增加一个计算节点
1. 克隆一台 compute1#
Copy
my_ip: 10.0.0.32
注意:
一定要打开虚拟化
2. 修改主机名#
Copy
hostnamectl set-hostname compute1
3. hosts解析 所有节点
#
Copy
10.0.0.11 controller
10.0.0.31 compute
10.0.0.32 compute1
Copy
scp /etc/hosts 10.0.0.31:/etc/hosts
scp /etc/hosts 10.0.0.32:/etc/hosts
4 . 配置yum源#
-
拉取软件包, 并将其 解压到 /opt 目录下#
Copy
curl -O http://10.0.0.98/openstack/openstack_rpm.tar.gz
tar zxvf openstack_rpm.tar.gz -C /opt/
-
配置yum源#
Copy
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.时间同步#
Copy
yum -y install chrony.x86_64
vim /etc/chrony.conf
……
server 10.0.0.11 iburst
systemctl restart chronyd
systemctl enable chronyd
6. 安装 openstack 软件包#
Copy
yum install python-openstackclient openstack-selinux -y
7.安装nova服务#
Copy
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服务#
Copy
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代理#
Copy
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 配置网络服务#
Copy
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.重启服务#
Copy
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
neutron agent-list
-
报错信息
Copy
tail -f /var/log/nova/nova-novncproxy.log
……
2022-09-15 09:59:29.776 21073 INFO nova.console.websocketproxy …… on: [Errno 113] EHOSTUNREACH
-
检查配置文件
-
检查防火墙
Copy
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)
关闭防火墙
Copy
systemctl stop firewalld.service
systemctl disable firewalld.service
关闭 selinux
Copy
vim /etc/selinux/config
……
SELINUX=disabled
-
重启服务
Copy
systemctl restart openstack-nova-compute.service
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通