openstack網絡服務Neutron(六)

1、Neutron控制節點安裝

 一、Neutron安裝

[root@linux-node1 ~]# yum install -y openstack-neutron openstack-neutron-ml2 \
openstack-neutron-linuxbridge ebtables

 

二、Neutron數據庫配置

[root@linux-node1 ~]# vim /etc/neutron/neutron.conf
[database]
connection = mysql+pymysql://neutron:neutron@192.168.56.11:3306/neutron

 

三、Keystone鏈接配置

[DEFAULT]
…
auth_strategy = keystone

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

 

四、RabbitMQ相關設置

[root@linux-node1 ~]# vim /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:openstack@192.168.56.11

 

五、Neutron網絡基礎配置

[DEFAULT]
core_plugin = ml2
service_plugins =

 

六、網絡拓撲變化Nova通知配置

[DEFAULT]
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True

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

 

七、配置鎖路徑

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

 

八、Neutron ML2配置

[root@linux-node1 ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan,geneve #支持多選,因此把全部的驅動都選擇上。
tenant_network_types = flat,vlan,gre,vxlan,geneve #支持多項,因此把全部的網絡類型都選擇上。
mechanism_drivers = linuxbridge,openvswitch,l2population #選擇插件驅動,支持多選,開源的有linuxbridge和openvswitch
#啓用端口安全擴展驅動
extension_drivers = port_security,qos

[ml2_type_flat]
#設置網絡提供
flat_networks = provider

[securitygroup]
#啓用ipset
enable_ipset = True

 

九、Neutron Linuxbridge配置

[root@linux-node1 ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:eth0

[vxlan]
#禁止vxlan網絡
enable_vxlan = False

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True

 

十、Neutron DHCP-Agent配置

[root@linux-node1 ~]# vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True

 

十一、Neutron metadata配置

[root@linux-node1 ~]# vim /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = 192.168.56.11

metadata_proxy_shared_secret = unixhot.com

 

十二、Neutron相關配置在nova.conf

[root@linux-node1 ~]# vim /etc/nova/nova.conf
[neutron]
url = http://192.168.56.11:9696
auth_url = http://192.168.56.11: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 = unixhot.com

[root@linux-node1 ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

 

1三、同步數據庫

[root@linux-node1 ~]# 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

 

1四、重啓計算API 服務

systemctl restart openstack-nova-api.service

 

1五、啓動網絡服務並配置他們開機自啓動

# 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

 

1六、Neutron服務註冊

# openstack service create --name neutron --description "OpenStack Networking" network
建立endpoint
# openstack endpoint create --region RegionOne network public http://192.168.56.11:9696
# openstack endpoint create --region RegionOne network internal http://192.168.56.11:9696
# openstack endpoint create --region RegionOne network admin http://192.168.56.11:9696

 

1七、測試Neutron安裝

[root@linux-node1 ~]# openstack network agent list

 

2、Neutron計算節點部署

 一、安裝軟件包

[root@linux-node2 ~]# yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables

 

二、Keystone鏈接配置

[root@linux-node2 ~]# vim /etc/neutron/neutron.conf
[DEFAULT]
…
auth_strategy = keystone

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

 

三、RabbitMQ相關設置

[root@linux-node2 ~]# vim /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:openstack@192.168.56.11
#請注意是在DEFAULT配置欄目下,由於該配置文件有多個transport_url的配置

 

四、鎖路徑

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

 

五、配置LinuxBridge配置

[root@linux-node1 ~]# scp /etc/neutron/plugins/ml2/linuxbridge_agent.ini 192.168.56.12:/etc/neutron/plugins/ml2/

 

六、設置計算節點的nova.conf

[root@linux-node2 ~]# vim /etc/nova/nova.conf
[neutron]
url = http://192.168.56.11:9696
auth_url = http://192.168.56.11:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

 

七、重啓計算服務

[root@linux-node2 ~]# systemctl restart openstack-nova-compute.service

 

八、啓動計算節點linuxbridge-agent

[root@linux-node2 ~]# systemctl enable neutron-linuxbridge-agent.service
[root@linux-node2 ~]# systemctl start neutron-linuxbridge-agent.service

 

九、在控制節點上測試Neutron安裝

[root@linux-node1 ~]# source admin-openstack.sh
[root@linux-node1 ~]# openstack network agent list
+--------------------------------------+--------------------+-------------------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host                    | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+-------------------------+-------------------+-------+-------+---------------------------+
| 0edfdc1a-f5be-44fe-86d8-4b56b85b1deb | Linux bridge agent | linux-node1.example.com | None              | :-)   | UP    | neutron-linuxbridge-agent |
| 281896e5-6946-4192-95f1-f2d7b8b9d2bc | DHCP agent         | linux-node1.example.com | nova              | :-)   | UP    | neutron-dhcp-agent        |
| bf75c379-beb3-4a5a-b003-5b136e4fcdf9 | Metadata agent     | linux-node1.example.com | None              | :-)   | UP    | neutron-metadata-agent    |
| ee34827e-2af6-40ce-9791-ad13902095ce | Linux bridge agent | linux-node2.example.com | None              | :-)   | UP    | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+-------------------------+-------------------+-------+-------+---------------------------+
相關文章
相關標籤/搜索