1. 程式人生 > >6、neutron服務部署與配置

6、neutron服務部署與配置

一、控制節點部署

1、資料庫配置

connection = mysql+pymysql://neutron:[email protected]/neutron

2、配置keystone

auth_strategy = keystone

[keystone_authtoken]
auth_uri = http://192.168.90.254:5000
auth_url = http://192.168.90.254:35357
memcached_servers = 192.168.90.254:11211
auth_type = password
project_domain_name 
= default user_domain_name = default project_name = service username = neutron password = neutron

3、配置rabbitmq

[DEFAULT]
transport_url = rabbit://openstack:[email protected]

4、啟用ML2

core_plugin = ml2

service_plugins =

5、配置nova

notify_nova_on_port_status_changes = true

notify_nova_on_port_data_changes 
= true [nova] auth_url = http://192.168.90.254:35357 auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = nova password = nova

6、配置鎖路徑

lock_path = /var/lib/neutron/tmp

7、配置ML2外掛

type_drivers = flat,vlan     啟用flat和VLAN網路
tenant_network_types 
= 禁用私有網路 mechanism_drivers = linuxbridge 啟用Linuxbridge機制 extension_drivers = port_security 啟用埠安全擴充套件驅動 flat_networks = provider 配置公共虛擬網路為flat網路 enable_ipset = true 啟用 ipset 增加安全組的方便性

8、配置Linuxbridge代理

physical_interface_mappings = provider:eth0   將公共虛擬網路和公共物理網路介面對應起來
firewall_driver =  
 neutron.agent.linux.iptables_firewall.IptablesFirewallDriver    配置 Linux 橋接 iptables 防火牆驅動
enable_security_group = true     啟用安全組 
enable_vxlan = false   禁止VXLAN覆蓋網路

9、配置DHCP代理

interface_driver = linuxbridge     配置Linuxbridge驅動介面
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq    
enable_isolated_metadata = true   DHCP驅動並啟用隔離元資料

10、配置元資料代理

vim /etc/neutron/metadata_agent.ini

nova_metadata_ip = 192.168.90.254   配置元資料主機
metadata_proxy_shared_secret = cbc   配置元資料共享密碼

11、配置nova使用neutron

vim /etc/nova/nova.conf

url = http://192.168.90.254:9696
auth_url = http://192.168.90.254:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
service_metadata_proxy = true
metadata_proxy_shared_secret = cbc

12、軟連結並同步資料庫

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
  --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

13、重啟計算節點nova-api服務

systemctl restart openstack-nova-api.service

14、開啟neutron服務

systemctl enable neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service

systemctl start neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service

15、建立neutron服務與端點

openstack service create --name neutron \
  --description "OpenStack Networking" network

openstack endpoint create --region RegionOne \
  network public http://192.168.90.254:9696

openstack endpoint create --region RegionOne \
  network internal http://192.168.90.254:9696

openstack endpoint create --region RegionOne \
  network admin http://192.168.90.254:9696

二、配置計算節點

1、配置neutron.conf

vim /etc/neutron/neutron.conf

transport_url = rabbit://openstack:[email protected]
auth_strategy = keystone
auth_uri = http://192.168.90.254:5000
auth_url = http://192.168.90.254:35357
memcached_servers = 192.168.90.254:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
lock_path = /var/lib/neutron/tmp

2、配置自提供網路

scp /etc/neutron/plugins/ml2/linuxbridge_agent.ini 192.168.90.250:/etc/neutron/plugins/ml2/
複製控制節點linuxbrige到計算節點

3、配置nova來使用neutron服務

vim /etc/nova/nova.conf

[neutron]

url = http://192.168.90.254:9696
auth_url = http://192.168.90.254:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

4、重啟nova服務

systemctl restart openstack-nova-compute.service

 

5、自啟動neutron服務

systemctl enable neutron-linuxbridge-agent.service

systemctl start neutron-linuxbridge-agent.service