ITPub博客

首页 > 数据库 > 数据库开发技术 > OpenStack离线Train版安装(十一)

OpenStack离线Train版安装(十一)

原创 数据库开发技术 作者:shuchaoyang 时间:2022-10-22 22:37:20 0 删除 编辑

11 计算节点-Neutron网络服务组件

官方参考:OpenStack官方安装指南:服务组件,Neutron-install,neutron-install-rdo,neutron-install-controller-install-rdo,neutron-install-controller-install-rdo。

11.1 安装的组件

yum install openstack-neutron-linuxbridge ebtables ipset -y

11.2 配置公共组件

网络公共组件配置包括身份验证机制,消息队列和插件。/etc/neutron/neutron.conf

cd 
touch compute-node-neutron.conf.sh
vim compute-node-neutron.conf.sh

compute-node-neutron.conf.sh文件内容为:

#!bin/bash
#compute-node-neutron.conf.sh
openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:openstack@controller

openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone

openstack-config --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password neutron

openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

echo "Result of Configuration"
egrep -v '(^$|^#)' /etc/neutron/neutron.conf
bash compute-node-neutron.conf.sh

11.3 配置网络选项

选择与为控制节点选择的相同网络选项以配置特定于该节点的服务。

11.3.1 配置网络选项一:Provider networks

配置:https://docs.openstack.org/neutron/train/install/compute-install-option1-rdo.html

(1)配置Linux网桥代理/etc/neutron/plugins/ml2/linuxbridge_agent.ini

Linux网桥代理为实例构建第2层(桥接和交换)虚拟网络基础结构并处理安全组。

cd 
touch compute-node-linuxbridge_agent.ini.sh
vim compute-node-linuxbridge_agent.ini.sh

compute-node-linuxbridge_agent.ini.sh文件内容

#!bin/bash
#compute-node-linuxbridge_agent.ini.sh

#map the provider virtual network to the provider physical network interface,the name of the underlying provider physical network interface

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens2f1

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan false

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

echo "Result of Configuration"
egrep -v '(^$|^#)' /etc/neutron/plugins/ml2/linuxbridge_agent.ini
bash compute-node-linuxbridge_agent.ini.sh

注:第一个选项physical_interface_mappings选项要配置计算节点自身的网卡名称provider:ens2f1

加载br_netfilter内核模块。要启用网络桥接器支持,通常br_netfilter内核模块需要加载。配置参考链接

echo net.bridge.bridge-nf-call-iptables = 1 >> /etc/sysctl.conf
echo net.bridge.bridge-nf-call-ip6tables = 1 >> /etc/sysctl.conf

modprobe br_netfilter
ls /proc/sys/net/bridge
sysctl -p

sysctl net.bridge.bridge-nf-call-iptables
sysctl net.bridge.bridge-nf-call-ip6tables

11.3.2 配置网络选项二:Self-service networks

配置:https://docs.openstack.org/neutron/train/install/compute-install-option2-rdo.html

(1)配置Linux网桥代理/etc/neutron/plugins/ml2/linuxbridge_agent.ini

Linux网桥代理为实例构建第2层(桥接和交换)虚拟网络基础结构并处理安全组。

#!bin/bash
#compute-node-linuxbridge_agent.ini.sh

#map the provider virtual network to the provider physical network interface,the name of the underlying provider physical network interface
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:ens2f1

#change to true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan true

#add new
#local_ip = OVERLAY_INTERFACE_IP_ADDRESS,replace OVERLAY_INTERFACE_IP_ADDRESS with the management IP address of the computes node
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 10.224.24.162
#add new
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

echo "Result of Configuration"
egrep -v '(^$|^#)' /etc/neutron/plugins/ml2/linuxbridge_agent.ini

加载br_netfilter内核模块。要启用网络桥接器支持,通常br_netfilter内核模块需要加载。配置参考链接

echo net.bridge.bridge-nf-call-iptables = 1 >> /etc/sysctl.conf
echo net.bridge.bridge-nf-call-ip6tables = 1 >> /etc/sysctl.conf

modprobe br_netfilter
ls /proc/sys/net/bridge
sysctl -p

sysctl net.bridge.bridge-nf-call-iptables
sysctl net.bridge.bridge-nf-call-ip6tables

11.4 配置计算节点Compute服务以使用网络服务

https://docs.openstack.org/neutron/train/install/compute-install-rdo.html#configure-the-compute-service-to-use-the-networking-service

/etc/nova/nova.conf在该[neutron]部分中,配置访问参数

cd 
touch compute-node-neutron-nova.conf.sh
vim compute-node-neutron-nova.conf.sh

compute-node-neutron-nova.conf.sh文件内容

#!bin/bash
#compute-node-neutron-nova.conf.sh
openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:5000
openstack-config --set /etc/nova/nova.conf neutron auth_type password
openstack-config --set /etc/nova/nova.conf neutron project_domain_name Default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name Default
openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name service
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password neutron

echo "Result of Configuration"
egrep -v '(^$|^#)' /etc/nova/nova.conf
bash compute-node-neutron-nova.conf.sh

11.5 计算节点网络服务安装的确定

11.5.1 重新启动计算服务

systemctl restart \
openstack-nova-compute.service
systemctl status \
openstack-nova-compute.service

11.5.2 启动Linux网桥代理,并配置开机自启

systemctl restart \
neutron-linuxbridge-agent.service
systemctl status \
neutron-linuxbridge-agent.service

systemctl enable \
neutron-linuxbridge-agent.service
systemctl list-unit-files |grep neutron* |grep enabled

至此,计算节点的网络配置完成,转回到控制节点进行验证操作,进行整个Neutron网络服务的最终验证。


有什么吐槽或反馈意见,直接告诉我!

温馨提示:如出现二维码失效也可直接添加微信号:ysc13803862469。


原文作者:超哥的IT私房菜;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论
专注于IT系统集成、运维、架构二十年的IT职场老兵,拥有CCNA、OCA、OCP、PGCA、PGCE认证证书,公众号:超哥的IT私房菜,知识星球:超哥的IT私房菜,目前是多家IT厂商的咨询顾问。

注册时间:2021-08-27

  • 博文量
    552
  • 访问量
    303470