|NO.Z.00019|——————————|^^^^ 部署 ^^^^|——|OpenStack&组件.V06|——|OpenStack-network|Open vSwitch(OVS)配置.V02|
一、安装并配置compute1节点
### --- 安装并配置compute1节点(若是你部署了多个compute节点的情况,重复去配置,方案是一样的)
~~~ 配置先决条件
~~~ 安装网络组件
~~~ 配置网络通用组建
~~~ 配置Modular Layer2(ML2)plug-in
~~~ 配置Open VSwitch(OVS)service
~~~ 配置计算服务使用网络
~~~ 完成安装
~~~ 验证
一、配置先决条件compute1节点配置
### --- 编辑/etc/sysctl.conf文件,使其包含下列参数:修改内核参数
[root@compute1 ~]# vim /etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
### --- 使/etc/sysctl.conf文件中更改生效。 刷新一下内核参数
[root@compute1 ~]# sysctl -p
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
二、安装网络组件
[root@compute1 ~]# yum install openstack-neutron-ml2 openstack-neutron-openvswitch
Installed:
openstack-neutron-ml2.noarch 0:2014.2-5.el7.centos openstack-neutron-openvswitch.noarch 0:2014.2-5.el7.centos
Dependency Installed:
conntrack-tools.x86_64 0:1.4.2-3.el7 crudini.noarch 0:0.4-1.el7 dnsmasq-utils.x86_64 0:2.66-12.el7 ipset.x86_64 0:6.19-4.el7
ipset-libs.x86_64 0:6.19-4.el7 libnetfilter_cthelper.x86_64 0:1.0.0-4.el7 libnetfilter_cttimeout.x86_64 0:1.0.0-2.el7 libnetfilter_queue.x86_64 0:1.0.2-2.el7
openstack-neutron.noarch 0:2014.2-5.el7.centos openstack-utils.noarch 0:2014.1-3.el7.centos.1 openvswitch.x86_64 0:2.1.2-2.el7.centos.1 python-jsonrpclib.noarch 0:0.1.3-1.el7
python-neutron.noarch 0:2014.2-5.el7.centos
Complete!
三、配置网络通用组件
### --- 编辑/etc/neutron/neutron.conf文件并完成下列操作:
[root@compute1 ~]# vim /etc/neutron/neutron.conf
# 编辑[database]小节,注释左右connection配置项,因为计算节点不能直接连接数据库
# 编辑[DEFAULT]小节,配置RabbitMQ消息代理访问:
[DEFAULT]
......
rpc_backend=rabbit
rabbit_host=controller.nice.com
rabbit_password=guest
# 编辑[DEFAULT]和[keystone_authtoken]小节,配置认证服务访问:
[DEFAULT]
......
auth_strategy=keystone
[keystone_authtoken]
......
auth_uri=http://controller.nice.com:5000/v2.0
identity_uri=http://controller.nice.com:35357
admin_tenant_name=service
admin_user=neutron
admin_password=NEUTRON_PASS
# 编辑[DEFAULT]小节,启用Modular Layer2(ML2),路由服务和重叠ip地址功能:
[DEFAULT]
......
core_plugin=ml2
service_plugins=router
allow_overlapping_ips=True
# (可选)在[DEFAULT]小节中配置详细日志输出,方便排错。
[DEFAULT]
......
verbose=True # 开启日志
四、配置Modular Layer2(ML2)plug-in
### --- 编辑/etc/neutron/plugins/ml2/ml2_conf.ini文件并完成下列操作:
[root@compute1 ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
# 编辑[ml2]小节,启用flat和generic routing encapsulation(GRE)网络类型驱动,GRE租户网络和OVS机制驱动。
[ml2]
......
type_drivers=flat,gre
tenant_network_types=gre
mechanism_drivers=openvswitch
# 编辑[ml2_type_gre]小节,配置隧道标识符(id)范围:
[ml2_type_gre]
......
tunnel_id_ranges=1:1000
# 编辑[securitygroup]小节,启用安装组,ipset并配置OVS iptables防火墙驱动:
[securitygroup]
......
enable_security_group=True
enable_ipset=True
firewall_driver=neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
# 编辑[OVS]小节,配置Open VSwitch(OVS)agent:
[OVS]
......
[OVS]
[OVS]
local_ip=172.16.0.10 # 实例网络的IP地址
tunnel_type=gre
enable_tunneling=True
五、配置Open VSwitch(OVS)service
### --- 启动OVS服务并设置开机自动启动:
[root@compute1 ~]# systemctl enable openvswitch.service
ln -s '/usr/lib/systemd/system/openvswitch.service' '/etc/systemd/system/multi-user.target.wants/openvswitch.service'
[root@compute1 ~]# systemctl start openvswitch.service
[root@compute1 ~]# systemctl status openvswitch.service
六、配置计算服务使用的网络
### --- 编辑/etc/nova/nova.conf文件并完成下列操作:
[root@compute1 ~]# vim /etc/nova/nova.conf
# 编辑[DEFAULT]小节,配置API接口和驱动:
[DEFAULT]
......
network_api_class=nova.network.neutronv2.api.API # neutron提供的API接口
security_group_api=neutron # neutron的安全组开启
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver # 配置网卡驱动
firewall_driver=nova.virt.firewall.NoopFirewallDriver # 防火墙配置
# 编辑[neutron]小节,配置访问参数: # 配置neutron的相关连接参数
[neutron]
......
url=http://controller.nice.com:9696 # 访问端点,访问neutron的端点,内部访问的端点
auth_strategy=keystone # 认证方式
admin_auth_url=http://controller.nice.com:35357/v2.0 # 管理员的访问端点
admin_tenant_name=service # 租户名称
admin_username=neutron # 管理员用户名
admin_password=NEUTRON_PASS # 管理员密码
七、完成安装:
### --- 创建网络服务初始化脚本的符号连接,
[root@compute1 ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
[root@compute1 ~]# cp /usr/lib/systemd/system/neutron-openvswitch-agent.service /usr/lib/systemd/system/neutron-openvswitch-agent.service.orig
[root@compute1 ~]# ll /usr/lib/systemd/system/neutron-openvswitch-agent.service
-rw-r--r-- 1 root root 437 Oct 30 2014 /usr/lib/systemd/system/neutron-openvswitch-agent.service
### --- 修改网络类型
[root@compute1 ~]# sed -i 's,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g' /usr/lib/systemd/system/neutron-openvswitch-agent.service
### --- 重启计算服务:
[root@compute1 ~]# systemctl restart openstack-nova-compute.service
### --- 启动OVS代理服务并设置开机自动启动:
[root@compute1 ~]# systemctl enable neutron-openvswitch-agent.service
ln -s '/usr/lib/systemd/system/neutron-openvswitch-agent.service' '/etc/systemd/system/multi-user.target.wants/neutron-openvswitch-agent.service'
[root@compute1 ~]# systemctl start neutron-openvswitch-agent.service
[root@compute1 ~]# systemctl status neutron-openvswitch-agent.service
八、验证(在controller)节点执行下列命令
### --- 执行admin环境变量脚本
[root@controller ~]# source admin-openrc.sh
### --- 列出neutron代理,确认启动neutron agents成功。
[root@controller ~]# neutron agent-list
+--------------------------------------+--------------------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | alive | admin_state_up | binary |
+--------------------------------------+--------------------+-------------------+-------+----------------+---------------------------+
| 25122ee3-54d0-4013-9e32-c752bb444874 | Metadata agent | network.nice.com | :-) | True | neutron-metadata-agent |
| 29e66a01-d01a-4bdb-8231-9adcf062b29b | Open vSwitch agent | network.nice.com | :-) | True | neutron-openvswitch-agent |
| 36e27e39-8e6b-4673-914b-ca3dd6ebf5ec | L3 agent | network.nice.com | :-) | True | neutron-l3-agent |
| 82964596-8d90-4001-b52a-6aa1e183c92a | DHCP agent | network.nice.com | :-) | True | neutron-dhcp-agent |
| a6cdf9f1-426a-4614-ab81-659168f846cf | Open vSwitch agent | compute1.nice.com | :-) | True | neutron-openvswitch-agent |
+--------------------------------------+--------------------+-------------------+-------+----------------+---------------------------+
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
分类:
cdv012-openstack
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」