openstack学习之十——计算节点安装neutron

317 阅读1分钟

安装neutron相关服务

安装服务

yum install openstack-neutron-linuxbridge ebtables ipset

配置公用组件

配置公用组件文件位置是/etc/neutron/neutron.conf,内容如下

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

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
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

配置结算节点网络选项

openstack提供两个网络选项,一种是使用运营商网络(Provide networks),另一种是使用租户网络(Self-service networks),这里使用运营商网络(Provide networks)

配置linux bridge 组件

配置文件地址/etc/neutron/plugins/ml2/linuxbridge_agent.ini,配置内容如下:

[linux_bridge]
physical_interface_mappings = provider:eth1

[vxlan]
enable_vxlan = false

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

配置bridge-nf-call-iptables,编辑/etc/sysctl.conf

net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1

然后执行下面命令,让其生效

sysctl -p

如果出现如下错误

image.png

加载内核模块,即可解决

modprobe br_netfilter

配置计算服务使用网络服务

配置/etc/nova/nova.conf,添加如下内容

[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456

完成的nova.conf配置内容如下

[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@controller
my_ip = 10.0.0.31
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[api]
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = 123456

[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

[glance]
api_servers = http://controller:9292

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

[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = 123456

[libvirt]
virt_type = qemu

[neutron]
auth_url = http://controller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 123456

完成安装

重启nova-compute服务

systemctl restart openstack-nova-compute.service

启动linux bridge组件,并设置开机启动

systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service

完结撒花