一、Controller配置
1、安裝軟件
# yum –enablerepo=centos-openstack-ocata,epel -y install openstack-neutron openstack-neutron-ml2
2、修改配置文件/etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
transport_url = rabbit://openstack:password@172.16.100.10
[keystone_authtoken]
auth_uri = http://172.16.100.10:5000
auth_url = http://172.16.100.10:35357
memcached_servers = 172.16.100.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = servicepassword
[database]
connection = mysql+pymysql://neutron:password@172.16.100.10/neutron
[nova]
auth_url = http://172.16.100.10:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = servicepassword
[oslo_concurrency]
lock_path = $state_path/tmp
3、修改權限
# chmod 640 /etc/neutron/neutron.conf
# chgrp neutron /etc/neutron/neutron.conf
4、修改配置文件/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
#注釋以下幾行
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_ipset = True
5、修改/etc/nova/nova.conf
[DEFAULT]
use_neutron = True
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[neutron]
url = http://172.16.100.10:9696
auth_url = http://172.16.100.10:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = servicepassword
6、創建鏈接
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
7、同步數據庫
# su -s /bin/bash neutron -c “neutron-db-manage –config-file /etc/neutron/neutron.conf –config-file /etc/neutron/plugin.ini upgrade head”
8、重啟服務
# systemctl start neutron-server
# systemctl enable neutron-server
# systemctl restart openstack-nova-api
二、網絡節點配置
1、安裝軟件
# yum –enablerepo=centos-openstack-ocata,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch
2、修改配置文件/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:password@172.16.100.10
[keystone_authtoken]
auth_uri = http://172.16.100.10:5000
auth_url = http://172.16.100.10:35357
memcached_servers = 172.16.100.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = servicepassword
[oslo_concurrency]
lock_path = $state_path/lock
2、修改權限
# chmod 640 /etc/neutron/neutron.conf
# chgrp neutron /etc/neutron/neutron.conf
1
2
3、修改配置文件/etc/neutron/l3_agent.ini
# line 17: add
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
# line 100: add ( it’s OK with no value (set later if need) )
external_network_bridge =
4、修改配置文件/etc/neutron/dhcp_agent.ini
# line 17: add
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
# line 32: uncomment
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
# line 41: uncomment and change
enable_isolated_metadata = True
5、修改配置文件/etc/neutron/metadata_agent.ini
# line 22: uncomment and specify Nova API server
nova_metadata_ip = 172.16.100.10
# line 34: uncomment and specify any secret key you like
metadata_proxy_shared_secret = metadata_secret
6、修改配置文件/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
# line 247: uncomment and add
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
# end line: uncomment
enable_ipset = True
7、創建鏈接
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
8、重啟服務
# systemctl start openvswitch
# systemctl enable openvswitch
9、創建網橋
# ovs-vsctl add-br br-int
10、重啟服務
# for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do
systemctl start neutron-$service
systemctl enable neutron-$service
done
三、計算節點配置
1、安裝軟件
# yum –enablerepo=centos-openstack-ocata,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch
2、修改配置文件/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:password@172.16.100.10
[keystone_authtoken]
auth_uri = http://172.16.100.10:5000
auth_url = http://172.16.100.10:35357
memcached_servers = 172.16.100.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = servicepassword
[oslo_concurrency]
lock_path = $state_path/lock
3、修改權限
# chmod 640 /etc/neutron/neutron.conf
# chgrp neutron /etc/neutron/neutron.conf
4、修改/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
# line 247: uncomment and add
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
# end line: uncomment
enable_ipset = True
5、修改/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.100.10:9696
auth_url = http://172.16.100.10:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = servicepassword
service_metadata_proxy = True
metadata_proxy_shared_secret = metadata_secret
6、創建軟連接
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
1
7、啟動服務
# systemctl start openvswitch
# systemctl enable openvswitch
8、創建網橋
# ovs-vsctl add-br br-int
9、重啟服務并設置開機啟動
# systemctl restart openstack-nova-compute
# systemctl start neutron-openvswitch-agent
# systemctl enable neutron-openvswitch-agent
作者:【吳業亮】云計算開發工程師
本文來自投稿,不代表Linux運維部落立場,如若轉載,請注明出處:http://www.www58058.com/91211