搭建云平台(五) Neutron网络服务安装与部署

1、在控制节点上安装:

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

创建neutron服务数据库和管理账户

controll#
mysql -u root -p
password:openstack
mariadb>
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';
exit

在这里插入图片描述

创建neutron用户、赋予admin角色:

#openstack user create --domain default --password-prompt neutron

此处需要输入密码: neutron

#openstack role add --project service --user neutron admin

创建neutron服务、endpoint:

#openstack service create --name neutron --description "OpenStack Network" network
#openstack endpoint create --region RegionOne network public http://controll:9696
#openstack endpoint create --region RegionOne network internal http://controll:9696
#openstack endpoint create --region RegionOne network admin http://controll:9696

在这里插入图片描述

配置neutron各组件配置文件(共5个文件,先备份配置文件):

controll# cp /etc/neutron/neutron.conf  /etc/neutron/neutron.conf.bak
controll# vi /etc/neutron/neutron.conf

[DEFAULT]
core_plugin = ml2
service_plugins =
transport_url =rabbit://openstack:openstack@controll
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[database]
connection = mysql+pymysql://neutron:neutron@controll/neutron

[keystone_authtoken]
auth_uri = http://controll:5000
auth_url = http://controll:35357
memcached_servers = controll:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[nova]
auth_url = http://controll: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

controller#cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
controller# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings =provider:eth0 (自己主机网卡的名称)

[vxlan]
enable_vxlan = false

[securitygroup]
enable_security_group = true
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

controll# cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
controll# vi /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security

[ml2_type_flat]
flat_networks = provider

[securitygroup]
enable_ipset = true

controll# cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
controll# vi /etc/neutron/dhcp_agent.ini

[DEFAULT]
interface_driver = linuxbridge
dhcp_driver =neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

controll#cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak
controll#vi /etc/neutron/metadata_agent.ini

[DEFAULT]
nova_metadata_ip = controll
metadata_proxy_shared_secret = meta

修改nova配置(加上neutron配置信息):

controll# vi /etc/nova/nova.conf

[neutron]
url = http://controll:9696
auth_url = http://controll: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 = meta

创建指向/etc/neutron/plugin.ini的符号链接,指向ML2配置文件:

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini  /etc/neutron/plugin.ini

同步数据库

controll#
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

设置开机自启动并启动服务

controll# systemctl enable neutron-server.service neutron-linuxbridge-agent.service  neutron-dhcp-agent.service neutron-metadata-agent.service
controll# systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service openstack-nova-api.service

2、在使用Neutron服务的其他节点(计算节点)上安装以下组件:

yum install openstack-neutron-linuxbridge ebtables ipset –y

在这里插入图片描述
配置各组件(共2个文件):

compute#cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
compute#vi /etc/neutron/neutron.conf
 

[DEFAULT]
transport_url =rabbit://openstack:openstack@controll
auth_strategy = keystone

[keystone_authtoken]
auth_uri = http://controll:5000
auth_url = http://controll:35357
memcached_servers = controll:11211
auth_type = password
project_domain_name = default
user_domain_name = default
username = neutron
password = neutron

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

#绑定提供物理网络的网卡:

compute# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:eth0

[vxlan]
enable_vxlan = false

[securitygroup]
enable_security_group = true
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

#修改nova配置(加上neutron的配置信息):

compute# vi /etc/nova/nova.conf

[neutron]
url = http://controll:9696
auth_url = http://controll:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

#修改下面两项:

vif_plugging_is_fatal = false
vif_plugging_timeout=0

开机自启动、启动并查看服务(此部分尤其注意关闭防火墙)

compute#
systemctl enable neutron-linuxbridge-agent.service
systemctl restart neutron-linuxbridge-agent.service openstack-nova-compute.service

在这里插入图片描述

查看网络服务运行情况:

control#
openstack extension list --network
openstack network agent list
  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值