部署neutron-computer

1. 部署说明

部署地点: 计算节点(ip:192.168.0.184)。

2. 安装组件

yum install -y openstack-neutron-linuxbridge ebtables ipset openstack-neutron openstack-neutron-ml2

3. 配置通用组件

cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bac

请根据实际情况自行修改rabbitmq对应服务的ip。

crudini --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
crudini --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://guest:loongson@192.168.0.142:5672

crudini --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:loongson@controller:3306/neutron

crudini --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri http://controller:5000
crudini --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:5000
crudini --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers controller:11211
crudini --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
crudini --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
crudini --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
crudini --set /etc/neutron/neutron.conf keystone_authtoken project_name service
crudini --set /etc/neutron/neutron.conf keystone_authtoken username neutron
crudini --set /etc/neutron/neutron.conf keystone_authtoken password loongson

crudini --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

查看并核实已经修改的配置是否存在问题。

egrep -v "^#|^$" /etc/neutron/neutron.conf

输出信息:

#tee /etc/neutron/neutron.conf <<-'EOF'
#[DEFAULT]
#auth_strategy = keystone
#transport_url = rabbit://guest:loongson@192.168.0.142:5672
#[database]
#connection = mysql+pymysql://neutron:loongson@controller:3306/neutron
#[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 = loongson
#[oslo_concurrency]
#lock_path = /var/lib/neutron/tmp
#EOF

4. 配置网络选项

请根据实际情况自行修改local_ip的值。

cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bac
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan true
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.0.184
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group false
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver iptables

请根据实际情况自行修改provider的值。

crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:enp0s3f0
egrep -v "^#|^$" /etc/neutron/plugins/ml2/linuxbridge_agent.ini

输出信息:

#tee /etc/neutron/plugins/ml2/linuxbridge_agent.ini <<-'EOF'
#[vxlan]
#enable_vxlan = true
#local_ip = 192.168.0.184
#l2_population = true
#[securitygroup]
#enable_security_group = true
#firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#[linux_bridge]
#physical_interface_mappings = provider:enp0s3f0
#EOF

5. 备份ml2配置

cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini DEFAULT debug true
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan,vxlan
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge,l2population
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks provider
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:1000
crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset true
egrep -v "^#|^$"  /etc/neutron/plugins/ml2/ml2_conf.ini

输出信息:

#tee /etc/neutron/plugins/ml2/ml2_conf.ini <<-'EOF'
#[DEFAULT]
#debug = true
#[ml2]
#type_drivers = flat,vlan,vxlan
#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
#EOF

6. 配置linuxbridge_agent.ini

请根据实际情况自行修改local_ip的值。

cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan true
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 192.168.0.184
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population true
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group false
crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver iptables

请根据实际情况自行修改provider的值。

crudini --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:enp0s3f0
egrep -v "^#|^$"  /etc/neutron/plugins/ml2/linuxbridge_agent.ini

输出信息:

#tee /etc/neutron/plugins/ml2/linuxbridge_agent.ini <<-'EOF'
#[vxlan]
#enable_vxlan = true
#local_ip = 192.168.0.184
#l2_population = true
#[securitygroup]
#enable_security_group = true
#firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#[linux_bridge]
#physical_interface_mappings = provider:enp0s3f0
#EOF

7. 配置l3_agent.ini

cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
crudini --set /etc/neutron/l3_agent.ini DEFAULT interface_driver linuxbridge
egrep -v "^#|^$"  /etc/neutron/l3_agent.ini

输出信息:

#tee /etc/neutron/l3_agent.ini <<-'EOF'
#[DEFAULT]
#interface_driver = linuxbridge
#EOF

8. 配置dhcp_agent.ini

cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
crudini --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver linuxbridge
crudini --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
crudini --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata true
egrep -v "^#|^$"  /etc/neutron/dhcp_agent.ini

输出信息:

#tee /etc/neutron/dhcp_agent.ini <<-'EOF'
#[DEFAULT]
#interface_driver = linuxbridge
#dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
#enable_isolated_metadata = true
#EOF

9. 配置metadata_agent.ini

在对应项底下增加以下字段。

cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bac
crudini --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_host controller
crudini --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret devops
egrep -v "^#|^$"  /etc/neutron/metadata_agent.ini

输出信息:

#tee /etc/neutron/metadata_agent.ini <<-'EOF'
#[DEFAULT]
#nova_metadata_host = controller
#metadata_proxy_shared_secret = devops
#EOF

10. 重启neutron-agent服务,并配置开机启动

systemctl enable neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent neutron-l3-agent
systemctl restart neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent neutron-l3-agent
systemctl status neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent neutron-l3-agent

如果net.bridge.bridge-nf-call-iptables和net.bridge.bridge-nf-call-ip6tables的值为空,并且/proc/sys/net/bridge/不存在,执行modprobe br_netfilter重新加载。

配置/etc/nova/nova.conf。

注意:/etc/nova/nova.conf已在《6-nova-computer部署文档》中进行配置。

©龙芯开源社区 all right reserved,powered by Gitbook文档更新时间: 2025-01-15 10:59:56

results matching ""

    No results matching ""

    results matching ""

      No results matching ""