8.compute部署neutron服务

compute节点

安装软件包
yum -y install openstack-neutron-linuxbridge ebtables  ipset

修改配置文件:/etc/neutron/neutron.conf

#查看文件属性
ll /etc/neutron/neutron.conf
-rw-r----- 1 root neutron ... /etc/neutron/neutron.conf
#备份配置文件
cp /etc/neutron/neutron.conf{,.bak}
#重新生成配置文件
egrep -v '^#|^$' /etc/neutron/neutron.conf.bak > /etc/neutron/neutron.conf
#查看文件属性
ll /etc/neutron/neutron.conf
-rw-r----- 1 root neutron ... /etc/neutron/neutron.conf
#修改文件内容
vi /etc/neutron/neutron.conf
#指定连接的rabbitmq的用户密码123,指定使用keystone认证
[DEFAULT]
transport_url = rabbit://openstack:123@controller
auth_strategy = keystone
#配置keystone认证信息,注意将用户neutron密码改为:123
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123
#配置锁路径
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

8.compute部署neutron服务_第1张图片 

创建provider提供商网络

根据官方文档提供的创建实例的时候提供了两种网络,一种是 provider , 一种是self-service
provider network 又称为运营商网络, self-service network 又称为租户网络
参考地址: https://docs.openstack.org/neutron/train/install/compute-install-option1-rdo.html

compute节点

修改linuxbridge(网桥)插件配置文件:/etc/neutron/plugins/ml2/linuxbridge_agent.ini
#查看文件属性

ll /etc/neutron/plugins/ml2/linuxbridge_agent.ini
-rw-r----- 1 root neutron ...6524 5月 11 2021 /etc/neutron/plugins/ml2/linuxbridge_agent.ini
#备份配置文件
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
#查看文件属性
ll /etc/neutron/plugins/ml2/linuxbridge_agent.ini
 
#修改文件内容
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
# 指定桥接网络provider与本机ens34物理网卡做关联 后期给虚拟机分配 external(外部)网络地址,然后虚拟机就可以通过ens34上外网;桥接的物理网卡名有可能是bind0、br0等
physical_interface_mappings = provider:ens34
[vxlan]
#不启用vxlan
enable_vxlan = false
[securitygroup]
#启用安全组并配置 Linux 桥接 iptables 防火墙驱动
enable_security_group = true
firewall_driver =
neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

确保系统内核支持网桥过滤器

#加载modprobe br_netfilter网桥过滤器模块
modprobe br_netfilter && lsmod | grep br_netfilter
br_netfilter 22256 0
bridge 151336 1 br_netfilter
#修改内核配置文件/etc/sysctl.conf,开启ipv4与ipv6的网络过滤功能
vim /etc/sysctl.conf
...
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
#重新加载配置文件
sysctl -p

 

修改 nova 配置文件,用于 neutron 交互,配置文件: /etc/nova/nova.conf
vim /etc/nova/nova.conf
#指定neutron用户密码:123
[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123

8.compute部署neutron服务_第2张图片 

重启 nova-api 服务
systemctl restart openstack-nova-compute.service

 开启neutron服务、设置开机自启动

systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
systemctl is-active neutron-linuxbridge-agent.service

8.compute部署neutron服务_第3张图片 服务验证 

controller节点

切换 admin 身份查看下网络服务
source admin-openrc
openstack network agent list

 到这里为止我们的网络服务neutron就搭建完毕了,现在我们的OpenStack环境就已经达到了启动实例的条件了。

 

你可能感兴趣的:(Openstack,java,开发语言)