(1)在各个计算节点上,安装网络服务
1)在nova计算节点上安装neutorn各个组件yum -y install openstack-neutron
yum -y install openstack-neutron-ml2
yum -y install openstack-neutron-openvswitch
2)在nova计算节点配置neutron相关组件
编辑/etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
allow_overlapping_ips = true
transport_url = rabbit://openstack:RABBIT_PASS@172.16.70.202[keystone_authtoken]
auth_uri = http://172.16.70.201:5000
auth_url = http://172.16.70.201:35357
memcached_servers = 172.16.70.204:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[root@compute1 neutron]# grep '^[a-Z]' neutron.conf
编辑 /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan
tenant_network_types =
mechanism_drivers = openvswitch,l2population
extension_drivers = port_security
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enbale_ipset = true
[ml2_type_flat]
flat_networks = physnet1 #这个名字自定义,后面的配置要和它一样
4)修改配置文件/etc/neutron/plugins/ml2/openvswitch_agent.ini
[ovs]
bridge_mappings = physnet1:br-eth1 #br-eth1该名称是在后面创建的网桥名
5)在nova计算节点配置nova脚本的neutron信息编辑/etc/nova/nova.conf
[DEFAULT]
use_neutron = true
linuxnet_interface_driver =nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
vif_plugging_is_fatal = true
vif_plugging_timeout = 300
[neutron]url = http://172.16.70.207:9696
auth_url = http://172.16.70.201:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456
6)创建软连接
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
7)启动OVS
systemctl enable openvswitch
systemctl start openvswitch
8)创建网桥
ovs-vsctl add-br br-int (#创建用于同一台物理之间的内部通信的网桥)
ovs-vsctl add-br br-eth1 (#创建用于不同物理机之间的通信的网桥)
ovs-vsctl add-port br-eth1 eth1 (将eth1物理网卡加入到业务网桥中)使用该命令前,一定要启动openvswitch服务,systemctl start openvswitch
9)启动服务
systemctl restart openstack-nova-compute #更改nova.conf配置,所以重启服务
systemctl enable neutron-openvswitch-agent
systemctl start neutron-openvswitch-agent
以上三个配置文件COPY到其它计算节点上,并修改权限
(2)完成并验证服务
1)重启nova计算节点的服务systemctl restart openstack-nova-compute #更改nova.conf配置,所以重启服务
2)将nova计算节点安装的网桥服务设为开机启动
systemctl enable neutron-openvswitch-agent
systemctl start neutron-openvswitch-agent
3)查看服务
[root@neutron1 neutron]# neutron agent-list
安装完成三个计算节点时的neutron代理列表