OpenStack 06 安装--neutron

本文详细介绍OpenStack Neutron网络服务的配置流程,包括数据库创建、服务实体建立、API配置、组件安装及配置文件编辑等关键步骤。涵盖主配置节点与计算节点的详细设置,以及网络代理、密钥和元数据代理的配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

主配置节点

创建数据库115
[root@vmysql ~]#mysql -u root -p123456
MariaDB [(none)] CREATE DATABASE neutron;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron123';

主控制  111
[controller1]source  scripts/admin-stein.sh 
[controller1]openstack user create --domain default --password-prompt neutron
[controller1]openstack role add --project service --user neutron admin


创建服务实体

[controller1] openstack service create --name neutron --description "OpenStack Networking" network


创建api
[controller1] openstack endpoint create --region RegionOne network public http://openstack-vip.magedu.net:9696

[controller1] openstack endpoint create --region RegionOne network internal http://openstack-vip.magedu.net:9696

[controller1] openstack endpoint create --region RegionOne network admin http://openstack-vip.magedu.net:9696


安装组件,选择官网第一个nat模式
[controller1] yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y



编辑配置文件111

vim /etc/neutron/neutron.conf
[database]
connection = mysql+pymysql://neutron:neutron123@openstack-vip.magedu.net/neutron


[DEFAULT]
core_plugin = ml2
service_plugins =
transport_url = rabbit://openstack:openstack123@openstack-vip.magedu.net
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true



[keystone_authtoken]
www_authenticate_uri = http://openstack-vip.magedu.net:5000
auth_url = http://openstack-vip.magedu.net:5000
memcached_servers = openstack-vip.magedu.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[nova]    #这个选项没有
auth_url = http://openstack-vip.magedu.net:5000
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








[controller1]vim /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
type_drivers = flat,vlan    #该[ml2]部分中,启用平面和VLAN网络:
tenant_network_types =     #在该[ml2]部分中,禁用自助服务网络:
mechanism_drivers = linuxbridge    #在本[ml2]节中,启用Linux桥接机制:
extension_drivers = port_security    # ...在该[ml2]部分中,启用端口安全性扩展驱动程序:

[ml2_type_flat]
flat_networks = external   #external 上外网internal内网将提供商虚拟网络配置为扁平网络

[securitygroup]
enable_ipset = true    # ...启用ipset以提高安全组规则的效率:




#配置Linux桥代理,下面三行也都没有
[controller1]vim  /etc/neutron/plugins/ml2/linuxbridge_agent.ini   
[linux_bridge]  
physical_interface_mappings = external:eth0

[vxlan]
enable_vxlan = false

[securitygroup]     # ...启用安全组并配置Linux网桥iptables防火墙驱动程序:
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver



#这个地方会报错忽略。
[controller1]vim /etc/sysctl.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
[controller1]sysctl -p


#配置dhcp代理
[controller1]$ vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true


#配置密钥。元数据代理
[controller1]$ vim /etc/neutron/metadata_agent.ini    
[DEFAULT]
nova_metadata_host = openstack-vip.magedu.net
metadata_proxy_shared_secret = 20190823



[controller1]$ vim /etc/nova/nova.conf
[neutron]
url = http://openstack-vip.magedu.net:9696
auth_url = http://openstack-vip.magedu.net:5000
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 = 20190823



#初始化数据库
[controller1]ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
[controller1]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
[controller1]systemctl restart openstack-nova-api.service
[controller1]systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
[controller1]systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service


计算节点

https://docs.openstack.org/neutron/stein/install/compute-install-rdo.html

113

[root@node1 ~]# yum install openstack-neutron-linuxbridge ebtables ipset -y
[root@node1 ~]# vim /etc/neutron/neutron.conf 

[DEFAULT]
transport_url = rabbit://openstack:openstack123@openstack-vip.magedu.net
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = http://openstack-vip.magedu.net:5000
auth_url = http://openstack-vip.magedu.net:5000
memcached_servers = openstack-vip.magedu.net:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

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




#还是选择第一种网络
[root@node1 ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings = external:eth0

[vxlan]
enable_vxlan = false

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



#确保您的Linux操作系统内核支持网桥过滤器
[root@node1 ~]# vim /etc/sysctl.conf    #之前的可以删掉,
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
[root@node1 ~]#sysctl -p  #此时会报错


[root@node1 ~]#vim /etc/nova/nova.conf

[neutron]
url = http://openstack-vip.magedu.net:9696
auth_url = http://openstack-vip.magedu.net:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron


[root@node1 ~]#systemctl restart openstack-nova-compute.service
[root@node1 ~]#systemctl enable neutron-linuxbridge-agent.service
[root@node1 ~]#systemctl start neutron-linuxbridge-agent.service
[root@node1 ~]#sysctl -p 此时正确


#验证操作在111操作。
[controller1] source  scripts/admin-stein.sh 
[controller1] openstack extension list --network
[controller1] openstack network agent list
[controller1] neutron agent-list

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值