码迷,mamicode.com
首页 > 其他好文 > 详细

##5 Neutron控制节点

时间:2018-11-30 11:17:05      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:控制   linux   tmp   server   install   bin   firewall   poi   pat   

###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:NEUTRON_DBPASS@controller/neutron

[DEFAULT]
# ...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:RABBIT_PASS@controller
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控制节点

标签:控制   linux   tmp   server   install   bin   firewall   poi   pat   

原文地址:https://www.cnblogs.com/yypr/p/10042293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!