openstack部署-neutron服务安装

本文介绍如何在OpenStack环境中安装和配置Neutron服务。包括创建数据库、配置权限、设置服务实体及API,以及详细配置各组件如ml2插件、DHCP代理等。同时涉及计算节点上的Neutron组件安装。

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

neutron 安装

       mysql -u root -p 进入数据库

CREATE DATABASE neutron; 创建数据库

设置权限

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \

  IDENTIFIED BY '123456';

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \

  IDENTIFIED BY '123456';

 

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 创建API

openstack endpoint create --region RegionOne \

  network internal http://controller:9696

openstack endpoint create --region RegionOne \

  network admin http://controller:9696

编辑/etc/neutron/neutron.conf文件

 

[database]

connection = mysql+pymysql://neutron:123456@controller/neutron

[DEFAULT]

# ...

core_plugin = ml2

service_plugins =

transport_url = rabbit://openstack:123456@controller

 

[DEFAULT]

# ...

auth_strategy = keystone

 

[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 = 123456

 

[DEFAULT]

# ...

notify_nova_on_port_status_changes = true

notify_nova_on_port_data_changes = true

 

[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 = 123456

 

[oslo_concurrency]

# ...

lock_path = /var/lib/neutron/tmp

 

编辑/etc/neutron/plugins/ml2/ml2_conf.ini

type_drivers = flat,vlan

tenant_network_types =

mechanism_drivers = linuxbridge

extension_drivers = port_security

flat_networks = provider

enable_ipset = true

 

编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini 

physical_interface_mappings = provider:ens33

enable_vxlan = false

(下两个未找到)

enable_security_group = true

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

 

编辑/etc/neutron/dhcp_agent.ini

interface_driver = linuxbridge

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq

enable_isolated_metadata = true

 

编辑/etc/neutron/metadata_agent.ini

nova_metadata_host = controller

metadata_proxy_shared_secret = METADATA_SECRET

 

编辑/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 = 123456

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 填充数据库

 

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-linuxbridge-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

 

计算节点安装

yum install openstack-neutron-linuxbridge ebtables ipset 安装

编辑/etc/neutron/neutron.conf

[DEFAULT]

# ...

transport_url = rabbit://openstack:123456@controller 

[DEFAULT]

# ...

auth_strategy = keystone

 

[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 = 123456

 

[oslo_concurrency]

# ...

lock_path = /var/lib/neutron/tmp

编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]

physical_interface_mappings = provider:ens33

[vxlan]

enable_vxlan = false

(下边两项无)

[securitygroup]

# ...

enable_security_group = true

firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

net.bridge.bridge-nf-call-iptables

net.bridge.bridge-nf-call-ip6tables

 

编辑 /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 = 123456

 

systemctl restart openstack-nova-compute.service

# systemctl enable neutron-linuxbridge-agent.service

# systemctl start neutron-linuxbridge-agent.service

systemctl status neutron-linuxbridge-agent.service

openstack network agent list 查看网络启动

日志位置/var/log/neutron/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值