##5 Neutron控制节点

Posted yypr

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了##5 Neutron控制节点相关的知识,希望对你有一定的参考价值。

###openstack-ocata 单节点安装 部署 目录汇总

 

 

一 创建数据库

mysql -u root -p

CREATE DATABASE neutron;

GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘NEUTRON_DBPASS‘;
GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘%‘ IDENTIFIED BY ‘NEUTRON_DBPASS‘;

--------------------------------------------------------------------------------


二 安装neutron 用户等

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

--------------------------------------------------------------------------------

 

三 安装自助网络模式 Self-service networks

yum install openstack-neutron openstack-neutron-ml2
openstack-neutron-linuxbridge ebtables -y

--------------------------------------------------------------------------------


四 配置自助网络模式文件
#备份文件
cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
> /etc/neutron/neutron.conf

echo ‘
[database]
# ...
connection = mysql+pymysql://neutron:[email protected]/neutron

[DEFAULT]
# ...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:[email protected]
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[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

[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

[oslo_concurrency]
# ...
lock_path = /var/lib/neutron/tmp
‘>>/etc/neutron/neutron.conf

 

cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
> /etc/neutron/plugins/ml2/ml2_conf.ini

echo ‘
[ml2]
# ...
type_drivers = flat,vlan,vxlan
[ml2]
# ...
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security

[ml2_type_flat]
# ...
flat_networks = provider

[ml2_type_vxlan]
# ...
vni_ranges = 1:1000

[securitygroup]
# ...
enable_ipset = true
‘>>/etc/neutron/plugins/ml2/ml2_conf.ini


vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini

cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
> /etc/neutron/plugins/ml2/linuxbridge_agent.ini


###provider 根据自己网卡名称修改 local_ip控制节点ip

echo ‘
[linux_bridge]
physical_interface_mappings = provider:ens33

[vxlan]
enable_vxlan = true
local_ip = 192.168.62.101
l2_population = true

[securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
‘>>/etc/neutron/plugins/ml2/linuxbridge_agent.ini


cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
> /etc/neutron/l3_agent.ini


echo ‘
[DEFAULT]
# ...
interface_driver = linuxbridge

vim /etc/neutron/dhcp_agent.ini

[DEFAULT]
# ...
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
‘>>/etc/neutron/l3_agent.ini


cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak
> /etc/neutron/metadata_agent.ini
vim /etc/neutron/metadata_agent.ini

echo ‘
[DEFAULT]
# ...
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET

‘>>/etc/neutron/metadata_agent.ini

#在nova中添加以下配置,password为neutron用户密码
vim /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
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET


--------------------------------------------------------------------------------


五 初始化数据

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

--------------------------------------------------------------------------------


六 重启nova服务,启动neutron服务

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

systemctl status neutron-server.service neutron-openvswitch-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service

systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service
systemctl status neutron-l3-agent.service

















































































































以上是关于##5 Neutron控制节点的主要内容,如果未能解决你的问题,请参考以下文章

##6.1 Neutron控制节点--openstack

openstack 部署笔记--neutron控制节点

Openstack 网络服务Neutron介绍和控制节点部署

Openstack 网络服务 Neutron计算节点部署

OpenStack Train版-8.安装neutron网络服务(控制节点)

在Ubuntu上学习OpenStack之七:控制节点上安装Neutron