openstackNetworking(neutron)服務(wù)篇
文縣網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、自適應(yīng)網(wǎng)站建設(shè)等網(wǎng)站項目制作,到程序開發(fā),運營維護。成都創(chuàng)新互聯(lián)從2013年創(chuàng)立到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗和運維經(jīng)驗,來保證我們的工作的順利進行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)。
在你配置OpenStack網(wǎng)絡(luò)(neutron)服務(wù),你必須創(chuàng)建一個數(shù)據(jù)庫,服務(wù)憑證和API端點。
MySQL -uroot -p123123
create database neutron;
grant all privileges on neutron.* to'neutron'@'localhost' identified by'123123';
grant all privileges on neutron.* to'neutron'@'%' identified by '123123';
exit;
sourceadmin-openrc
openstack user create --domain default--password-prompt neutron ##設(shè)置密碼
openstack role add --project service--user neutron admin
openstack service create --name neutron--description "OpenStack Networking" network
openstack endpoint create --regionRegionOne network public http://controller:9696
openstack endpoint create --regionRegionOne network internel http://controller:9696
openstack endpoint create --regionRegionOne network admin http://controller:9696
yum install openstack-neutronopenstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
vi /etc/neutron/neutron.conf
[database]
connection = mysql+pymysql://neutron:123123@controller/neutron ##配置數(shù)據(jù)庫訪問
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True ##啟用Modular Layer 2 (ML2)插件,路由服務(wù)和重疊的IP地址
auth_strategy = keystone ##配置認證服務(wù)訪問
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True ##配置網(wǎng)絡(luò)服務(wù)來通知計算節(jié)點的網(wǎng)絡(luò)拓撲變化
rpc_backend = rabbit ##配置RabbitMQ消息隊列的連接
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 123123 ##配置RabbitMQ消息隊列的連接
[keystone_authtoken] ##配置認證服務(wù)
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 = 123123 ##配置認證服務(wù),在 [keystone_authtoken] 中注釋或者刪除其他選項。
[nova] ##配置網(wǎng)絡(luò)以能夠反映計算網(wǎng)絡(luò)拓撲變化:
auth_url =http://controller:35357
auth_plugin = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = 123123 ##配置網(wǎng)絡(luò)以能夠反映計算網(wǎng)絡(luò)拓撲變化
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp ##配置鎖路徑
ML2插件使用Linux橋接機制為實例創(chuàng)建layer-2 (橋接/交換)虛擬網(wǎng)絡(luò)基礎(chǔ)設(shè)施。
vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan ##啟用flat,VLAN和VXLAN網(wǎng)絡(luò)
tenant_network_types = vxlan ##啟用VXLAN項目(私有)網(wǎng)絡(luò)
mechanism_drivers =linuxbridge,l2population ##啟用Linuxbridge和ayer-2機制
##在你配置ML2插件后,刪除可能導(dǎo)致數(shù)據(jù)庫不一致的``type_drivers``項的值,Linux橋接代理只支持VXLAN網(wǎng)絡(luò)。
extension_drivers = port_security ##啟用端口安全擴展驅(qū)動
[ml2_type_flat]
flat_networks = provider ##配置公共flat提供網(wǎng)絡(luò)
[ml2_type_vxlan]
vni_ranges = 1:1000 ##私有網(wǎng)絡(luò)配置VXLAN網(wǎng)絡(luò)識別的網(wǎng)絡(luò)范圍
[securitygroup]
enable_ipset = True ##啟用 ipset 增加安全組的方便性
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth3 ##映射公共虛擬網(wǎng)絡(luò)到公共物理網(wǎng)絡(luò)接口,將eth3替換為物理公共網(wǎng)絡(luò)接口。
[vxlan]
enable_vxlan = True
local_ip = 10.0.0.31
12_population = True ##啟用VXLAN覆蓋網(wǎng)絡(luò),配置處理覆蓋網(wǎng)絡(luò)和啟用layer-2 的物理網(wǎng)絡(luò)接口的IP地址
[securitygroup]
enable_security_group = True
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver ##啟用安全組并配置 Linux 橋接iptables 防火墻驅(qū)動
vi /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver =neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
##配置Linux橋接網(wǎng)絡(luò)驅(qū)動和外部網(wǎng)絡(luò)橋接,external_network_bridge選項故意缺少值,這樣就可以在一個代理上啟用多個外部網(wǎng)絡(luò)。
配置Linux橋接網(wǎng)卡驅(qū)動,DNSmasq DHCP驅(qū)動并啟用隔離元數(shù)據(jù),這樣在公共網(wǎng)絡(luò)上的實例就可以通過網(wǎng)絡(luò)訪問元數(shù)據(jù)
[DEFAULT]
interface_driver =neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = 123123 ##配置元數(shù)據(jù)代理共享密碼
vi /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 = 123123
service_metadata_proxy = True
metadata_proxy_shared_secret = 123123 ##配置訪問參數(shù),啟用元數(shù)據(jù)代理并設(shè)置密碼
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
##數(shù)據(jù)庫的同步發(fā)生在 Networking之后,因為腳本需要完成服務(wù)器和插件的配置文件。
systemctl restart openstack-nova-api.service
systemctl enableneutron-server.service neutron-linuxbridge-agent.serviceneutron-dhcp-agent.service neutron-metadata-agent.service
systemctl startneutron-server.service neutron-linuxbridge-agent.serviceneutron-dhcp-agent.service neutron-metadata-agent.service
systemctl enable neutron-13-agent.service
systemctlstart neutron-13-agent.service
yum install openstack-neutronopenstack-neutron-linuxbridge ebtables ipset
Networking通用組件的配置包括認證機制、消息隊列和插件
在[database]部分,注釋所有connection項,因為計算節(jié)點不直接訪問數(shù)據(jù)庫
[DEFAULT]
rpc_backend = rabbit ##配置RabbitMQ消息隊列訪問
auth_strategy = keystone ##配置認證服務(wù)訪問
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 123123 ##配置RabbitMQ消息隊列訪問
[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 = 123123 ##配置認證服務(wù)訪問,在 [keystone_authtoken] 中注釋或者刪除其他選項。
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp ##配鎖路徑
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth3
##映射公共虛擬網(wǎng)絡(luò)到公共物理網(wǎng)絡(luò)接口,將eth3替換為物理公共網(wǎng)絡(luò)接口
[vxlan]
enable_vxlan = True
local_ip = 10.0.0.31
12_population = True ##啟用VXLAN覆蓋網(wǎng)絡(luò),配置處理覆蓋網(wǎng)絡(luò)和啟用layer-2的物理網(wǎng)絡(luò)接口的IP地址
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
##用安全組并配置Linux 橋接 iptables 防火墻驅(qū)動:
vi /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 = 123123 ##配置訪問參數(shù)
systemctl restartopenstack-nova-compute.service
systemctl enableneutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
source admin-openrc
neutron ext-list
neutron agent-list