您好,登錄后才能下訂單哦!
openstackNetworking(neutron)服務篇
在你配置OpenStack網絡(neutron)服務,你必須創建一個數據庫,服務憑證和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 ##設置密碼
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 ##配置數據庫訪問
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True ##啟用Modular Layer 2 (ML2)插件,路由服務和重疊的IP地址
auth_strategy = keystone ##配置認證服務訪問
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True ##配置網絡服務來通知計算節點的網絡拓撲變化
rpc_backend = rabbit ##配置RabbitMQ消息隊列的連接
[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 ##配置認證服務,在 [keystone_authtoken] 中注釋或者刪除其他選項。
[nova] ##配置網絡以能夠反映計算網絡拓撲變化:
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 ##配置網絡以能夠反映計算網絡拓撲變化
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp ##配置鎖路徑
ML2插件使用Linux橋接機制為實例創建layer-2 (橋接/交換)虛擬網絡基礎設施。
vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan ##啟用flat,VLAN和VXLAN網絡
tenant_network_types = vxlan ##啟用VXLAN項目(私有)網絡
mechanism_drivers =linuxbridge,l2population ##啟用Linuxbridge和ayer-2機制
##在你配置ML2插件后,刪除可能導致數據庫不一致的``type_drivers``項的值,Linux橋接代理只支持VXLAN網絡。
extension_drivers = port_security ##啟用端口安全擴展驅動
[ml2_type_flat]
flat_networks = provider ##配置公共flat提供網絡
[ml2_type_vxlan]
vni_ranges = 1:1000 ##私有網絡配置VXLAN網絡識別的網絡范圍
[securitygroup]
enable_ipset = True ##啟用 ipset 增加安全組的方便性
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth3 ##映射公共虛擬網絡到公共物理網絡接口,將eth3替換為物理公共網絡接口。
[vxlan]
enable_vxlan = True
local_ip = 10.0.0.31
12_population = True ##啟用VXLAN覆蓋網絡,配置處理覆蓋網絡和啟用layer-2 的物理網絡接口的IP地址
[securitygroup]
enable_security_group = True
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver ##啟用安全組并配置 Linux 橋接iptables 防火墻驅動
vi /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver =neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
##配置Linux橋接網絡驅動和外部網絡橋接,external_network_bridge選項故意缺少值,這樣就可以在一個代理上啟用多個外部網絡。
配置Linux橋接網卡驅動,Dnsmasq DHCP驅動并啟用隔離元數據,這樣在公共網絡上的實例就可以通過網絡訪問元數據
[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 ##配置元數據代理共享密碼
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 ##配置訪問參數,啟用元數據代理并設置密碼
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
##數據庫的同步發生在 Networking之后,因為腳本需要完成服務器和插件的配置文件。
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項,因為計算節點不直接訪問數據庫
[DEFAULT]
rpc_backend = rabbit ##配置RabbitMQ消息隊列訪問
auth_strategy = keystone ##配置認證服務訪問
[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 ##配置認證服務訪問,在 [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
##映射公共虛擬網絡到公共物理網絡接口,將eth3替換為物理公共網絡接口
[vxlan]
enable_vxlan = True
local_ip = 10.0.0.31
12_population = True ##啟用VXLAN覆蓋網絡,配置處理覆蓋網絡和啟用layer-2的物理網絡接口的IP地址
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
##用安全組并配置Linux 橋接 iptables 防火墻驅動:
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 ##配置訪問參數
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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。