控制節(jié)點配置
建立數(shù)據(jù)庫
mysql -u root -p
mysql> CREATE DATABASE neutron;
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
IDENTIFIED BY 'NEUTRON_DBPASS';
mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
IDENTIFIED BY 'NEUTRON_DBPASS';
openstack創(chuàng)建用戶
首先執(zhí)行admin的環(huán)境變量腳本
openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron \
--description "OpenStack Networking" network
openstack endpoint create --region RegionOne \
network public http://controller:9696
openstack endpoint create --region RegionOne \
network internal http://controller:9696
openstack endpoint create --region RegionOne \
network admin http://controller:9696
neutron安裝與配置
yum install openstack-neutron openstack-neutron-ml2 \
openstack-neutron-linuxbridge ebtables
編輯配置文件/etc/neutron/neutron.conf,添加或者修改如下條目
[DEFAULT]
...
core_plugin = ml2
service_plugins =
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
[database]
...
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = NEUTRON_PASS
[nova]
...
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
配置ML2插件
編輯文件/etc/neutron/plugins/ml2/ml2_conf.ini
,添加或修改如下條目
[ml2]
...
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
flat_networks = provider
enable_ipset = True
配置Linux bridge代理
編輯文件/etc/neutron/plugins/ml2/linuxbridge_agent.ini
,添加或者修改如下條目
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
[vxlan]
enable_vxlan = False
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
配置DHCP代理
編輯文件/etc/neutron/dhcp_agent.ini
,添加或修改如下條目
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
配置metadata代理
編輯文件/etc/neutron/metadata_agent.ini
,添加或修改如下條目
[DEFAULT]
...
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET
為nova組件配置網(wǎng)絡(luò)服務(wù)
編輯文件/etc/nova/nova.conf
,添加或修改如下條目
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
service_metadata_proxy = True
metadata_proxy_shared_secret = METADATA_SECRET
結(jié)束安裝
網(wǎng)絡(luò)服務(wù)需要一個ml2插件的初始配置文件侠畔,建立鏈接
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
同步數(shù)據(jù)庫
/bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
重啟nova服務(wù)
systemctl restart openstack-nova-api.service
添加開機啟動
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
配置計算節(jié)點
配置neutron
yum install openstack-neutron-linuxbridge ebtables ipset
編輯配置文件/etc/neutron/neutron.conf
,添加或修改如下條目
[DEFAULT]
...
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = NEUTRON_PASS
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
配置 Linux bridge 代理
編輯文件/etc/neutron/plugins/ml2/linuxbridge_agent.ini
,
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
[vxlan]
enable_vxlan = False
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
配置nova組件使用網(wǎng)絡(luò)服務(wù)
編輯文件/etc/nova/nova.conf
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
結(jié)束安裝
重啟nova服務(wù)
systemctl restart openstack-nova-compute.service
添加開機啟動
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
驗證操作
在controller節(jié)點上,首先執(zhí)行admin的環(huán)境變量腳本结缚,然后查看neutron的extension運行情況
neutron ext-list
列出網(wǎng)絡(luò)代理,會顯示3個control代理和一個linux代理
openstack network agent list
至此核心組件就安裝完了