云计算:OpenStack 分布式架构部署(单控制节点与多计算节点)

目录

一、实验

1.环境

[2. 计算服务安装(计算节点2)](#2. 计算服务安装(计算节点2))

[3. 网络服务安装(计算节点2)](#3. 网络服务安装(计算节点2))


一、实验

1.环境

(1) 主机

表1 主机

|------------|-------|-----------------|-----|
| 主机 | 架构 | IP | 备注 |
| controller | 控制节点 | 192.168.204.210 | 已部署 |
| compute01 | 计算节点1 | 192.168.204.211 | 已部署 |
| compute02 | 计算节点2 | 192.168.204.212 | |

(2)官网

OpenStack Docs: OpenStack Installation Guide for Red Hat Enterprise Linux and CentOS

(3)网络

①计算节点2 ping 控制节点

②计算节点2 ping 计算节点1

(4) 时间同步

① 计算节点2

bash 复制代码
[root@compute02 ~]# yum install -y chrony

bash 复制代码
[root@compute02 ~]# vim /etc/chrony.conf
[root@compute02 ~]# systemctl restart chronyd.service && systemctl enable chronyd.service

③测试

bash 复制代码
[root@controller ~]# date

[root@compute01 ~]# date

[root@compute02 ~]# date

(5) 控制节点查看(目前已部署controller与compute01)

bash 复制代码
# neutron agent-list

2. 计算服务安装(计算节点2)

(1)安装软件包

bash 复制代码
# yum install python-openstackclient.noarch openstack-selinux.noarch -y

# yum install openstack-nova-compute libvirt -y

# yum install openstack-utils.noarch -y

(2)编辑/etc/nova/nova.conf

①在DEFAULT和 oslo_messaging_rabbit部分,配置RabbitMQ消息队列的连接

bash 复制代码
[DEFAULT]
...
rpc_backend = rabbit

[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

② 在 DEFAULT和 keystone_authtoken 部分,配置认证服务访问

bash 复制代码
[DEFAULT]
...
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 = nova
password = NOVA_PASS

③ 在 DEFAULT 部分,配置 my_ip 选项

bash 复制代码
[DEFAULT]
...
my_ip = 192.168.204.212

④ 在 DEFAULT 部分,使能 Networking 服务

bash 复制代码
[DEFAULT]
...
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

⑤ 在vnc部分,启用并配置远程控制台访问

bash 复制代码
[vnc]
...
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

⑥在 glance 区域,配置镜像服务 API 的位置

bash 复制代码
[glance]
...
api_servers = http://controller:9292

⑦ 在 oslo_concurrency 部分,配置锁路径

bash 复制代码
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

⑧ 备份修改

(3)完成安装

① 确定计算节点是否支持虚拟机的硬件加速

bash 复制代码
$ egrep -c '(vmx|svm)' /proc/cpuinfo

(4)验证操作

3. 网络服务安装(计算节点2)

(1)安装组件

bash 复制代码
# yum install openstack-neutron-linuxbridge ebtables ipset

(2)配置通用组件,编辑/etc/neutron/neutron.conf文件

①在database部分,注释所有connection项,因为计算节点不直接访问数据库;

②在 DEFAULT和 oslo_messaging_rabbit部分,配置 RabbitMQ消息队列的连接

bash 复制代码
[DEFAULT]
...
rpc_backend = rabbit

[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

③ 在 DEFAULT和 keystone_authtoken部分,配置认证服务访问(将 NEUTRON_PASS 替换为在认证服务中为 neutron 用户选择的密码)

bash 复制代码
[DEFAULT]
...
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 部分,配置锁路径

bash 复制代码
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp

⑤ 备份修改

(3) 配置Linuxbridge代理,编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini

① 在linux_bridge部分,将公共虚拟网络和公共物理网络接口对应起来

bash 复制代码
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME

② 在vxlan部分,禁止VXLAN覆盖网络

bash 复制代码
[vxlan]
enable_vxlan = False

③ 在 securitygroup部分,启用安全组并配置 Linuxbridge iptables firewall driver

bash 复制代码
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

④ 备份修改

(4)配置网络选项,编辑/etc/nova/nova.conf文件

①在neutron部分,配置访问参数

bash 复制代码
[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

(5) 查看服务列表

bash 复制代码
# openstack compute service list

(6)完成安装

①重启计算服务

bash 复制代码
# systemctl restart openstack-nova-compute.service

②启动Linuxbridge代理并配置它开机自启动

bash 复制代码
# systemctl enable neutron-linuxbridge-agent.service
# systemctl start neutron-linuxbridge-agent.service

(7)控制节点查看(已新增compute02)

bash 复制代码
# neutron agent-list
相关推荐
天空属于哈夫克33 天前
企业微信二次开发:精准实现关键词自动回复
架构·企业微信
晨米酱3 天前
AGENTS.md:Agent 的上下文策略层
面试·架构·agent
这个DBA有点耶3 天前
MVCC深入:Read View、版本链与快照读——InnoDB并发控制的内核
数据库·mysql·架构
码流子3 天前
高速公路安全监测实践:碰撞监测预警+物联网底座,从感知到处置的闭环
大数据·人工智能·物联网·算法·架构
moMo3 天前
从固定流程到问题路由:让 LangGraph RAG 按需检索
架构
白远山3 天前
上海24小时自助健身房解决方案实战指南与经验分享
java·数据库·架构·需求分析
LorryJovens3 天前
【LAAP科研】双系统具身AGI范式研究——基于LAAP认知架构与Jev概率决策模型的系统性技术调研与范式验证
人工智能·gpt·安全·架构
JQweryuiop4 天前
中小型游戏陪练工作室数字化管理实践:基于七彩屋电竞护航小程序订单、履约与绩效系统的落地复盘
大数据·游戏·小程序·架构
LONGZETECH4 天前
一线职教实测:风光 580 汽车故障诊断仿真系统,破解实车实训四大核心痛点
人工智能·学习·安全·架构·汽车
小葱运维4 天前
命名与环境规范
运维·开源·云计算