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:eth2 ##映射公共虚拟网络到公共物理网络接口,将eth2替换为物理公共网络接口。
[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:eth2
##映射公共虚拟网络到公共物理网络接口,将eth2替换为物理公共网络接口
[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
本文出自 “19941212” 博客,请务必保留此出处http://19941212.blog.51cto.com/11630936/1902964
openstack Networking(neutron)服务篇
原文:http://19941212.blog.51cto.com/11630936/1902964