9 Openstack-Ussuri-Neutron控制/计算节点集群部署-centos8

Nova具体功能如下:
1 Neutron 为整个 OpenStack 环境提供网络支持,包括二层交换,三层路由,负载均衡,防火墙和 VPN 等。
2 Neutron 提供了一个灵活的框架,通过配置,无论是开源还是商业软件都可以被用来实现这些功能。

9.1 配置neutron数据库

#使用root登陆数据库:

mysql -u root -p

#创建neutron数据库:

CREATE DATABASE neutron;

#授予对neutron数据库的访问权限,刷新退出数据库:

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
  IDENTIFIED BY 'neutron.123';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
  IDENTIFIED BY 'neutron.123';
  
flush privileges;
exit

9.2 加载管理凭证

source adminrc.sh

9.3 创建neutron相关服务凭证

#创建neutron服务用户,并设置密码为neutron.123

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

#输出

User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 1277a3124b5d40a1ad8872cf9a948da6 |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

#赋予neutron服务用户服务管理员权限及角色,无输出

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

#创建neutron服务

openstack service create --name neutron --description "OpenStack Networking" network

#输出

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | 2298a17eee9d46cdb474801a505bd4c0 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+

9.4 创建compute API endpoints

#public

openstack endpoint create --region RegionOne network public http://controller168:9696

#输出

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a853c8d22f694016b53b2495ec868389 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 2298a17eee9d46cdb474801a505bd4c0 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller168:9696        |
+--------------+----------------------------------+

#internal

openstack endpoint create --region RegionOne network internal http://controller168:9696

#输出

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d91dfe23c12c47a2909f00d7fc23cebd |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 2298a17eee9d46cdb474801a505bd4c0 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller168:9696        |
+--------------+----------------------------------+

#admin

openstack endpoint create --region RegionOne network admin http://controller168:9696

#输出

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 343e3e4d419a40aeb4480ea4d5b4c549 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 2298a17eee9d46cdb474801a505bd4c0 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller168:9696        |
+--------------+----------------------------------+

9.5 部署与配置neutron server - ALL Controller

#安装包

yum install openstack-neutron openstack-neutron-ml2 -y

#备份neutron配置

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

#配置neutron配置文件,在对应项底下增加以下字段
#vim /etc/neutron/neutron.conf

[DEFAULT]
# ...
bind_host = 172.16.1.160
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
auth_strategy = keystone
transport_url = rabbit://rabbitmq:rabbitmq.123@controller160:5672,rabbitmq:rabbitmq.123@controller161:5672,rabbitmq:rabbitmq.123@controller162:5672
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
[database]
# ...
connection = mysql+pymysql://neutron:neutron.123@controller168/neutron

[keystone_authtoken]
# ...
www_authenticate_uri = http://controller168:5000
auth_url = http://controller168:5000
memcached_servers = controller160:11211,controller161:11211,controller162:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = neutron.123

# ...

[nova]
# ...
auth_url = http://controller168:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova.123

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

#修改nova配置文件,在对应项底下增加以下字段
#vim /etc/nova/nova.conf

[neutron]
# ...
auth_url = http://controller168:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron.123
service_metadata_proxy = true
metadata_proxy_shared_secret = devops

#配置ml2配置文件,在对应项底下增加以下字段

cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
egrep -v "^$|^#" /etc/neutron/plugins/ml2/ml2_conf.ini.bak >/etc/neutron/plugins/ml2/ml2_conf.ini

#vim /etc/neutron/plugins/ml2/ml2_conf.ini

[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

#填充neutron数据库

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

#输出

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for neutron ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> kilo
INFO  [alembic.runtime.migration] Running upgrade kilo -> 354db87e3225
INFO  [alembic.runtime.migration] Running upgrade 354db87e3225 -> 599c6a226151
INFO  [alembic.runtime.migration] Running upgrade 599c6a226151 -> 52c5312f6baf
INFO  [alembic.runtime.migration] Running upgrade 52c5312f6baf -> 313373c0ffee
INFO  [alembic.runtime.migration] Running upgrade 313373c0ffee -> 8675309a5c4f
INFO  [alembic.runtime.migration] Running upgrade 8675309a5c4f -> 45f955889773
INFO  [alembic.runtime.migration] Running upgrade 45f955889773 -> 26c371498592
INFO  [alembic.runtime.migration] Running upgrade 26c371498592 -> 1c844d1677f7
INFO  [alembic.runtime.migration] Running upgrade 1c844d1677f7 -> 1b4c6e320f79
INFO  [alembic.runtime.migration] Running upgrade 1b4c6e320f79 -> 48153cb5f051
INFO  [alembic.runtime.migration] Running upgrade 48153cb5f051 -> 9859ac9c136
INFO  [alembic.runtime.migration] Running upgrade 9859ac9c136 -> 34af2b5c5a59
INFO  [alembic.runtime.migration] Running upgrade 34af2b5c5a59 -> 59cb5b6cf4d
INFO  [alembic.runtime.migration] Running upgrade 59cb5b6cf4d -> 13cfb89f881a
INFO  [alembic.runtime.migration] Running upgrade 13cfb89f881a -> 32e5974ada25
INFO  [alembic.runtime.migration] Running upgrade 32e5974ada25 -> ec7fcfbf72ee
INFO  [alembic.runtime.migration] Running upgrade ec7fcfbf72ee -> dce3ec7a25c9
INFO  [alembic.runtime.migration] Running upgrade dce3ec7a25c9 -> c3a73f615e4
INFO  [alembic.runtime.migration] Running upgrade c3a73f615e4 -> 659bf3d90664
INFO  [alembic.runtime.migration] Running upgrade 659bf3d90664 -> 1df244e556f5
INFO  [alembic.runtime.migration] Running upgrade 1df244e556f5 -> 19f26505c74f
INFO  [alembic.runtime.migration] Running upgrade 19f26505c74f -> 15be73214821
INFO  [alembic.runtime.migration] Running upgrade 15be73214821 -> b4caf27aae4
INFO  [alembic.runtime.migration] Running upgrade b4caf27aae4 -> 15e43b934f81
INFO  [alembic.runtime.migration] Running upgrade 15e43b934f81 -> 31ed664953e6
INFO  [alembic.runtime.migration] Running upgrade 31ed664953e6 -> 2f9e956e7532
INFO  [alembic.runtime.migration] Running upgrade 2f9e956e7532 -> 3894bccad37f
INFO  [alembic.runtime.migration] Running upgrade 3894bccad37f -> 0e66c5227a8a
INFO  [alembic.runtime.migration] Running upgrade 0e66c5227a8a -> 45f8dd33480b
INFO  [alembic.runtime.migration] Running upgrade 45f8dd33480b -> 5abc0278ca73
INFO  [alembic.runtime.migration] Running upgrade kilo -> 30018084ec99
INFO  [alembic.runtime.migration] Running upgrade 30018084ec99 -> 4ffceebfada
INFO  [alembic.runtime.migration] Running upgrade 4ffceebfada -> 5498d17be016
INFO  [alembic.runtime.migration] Running upgrade 5498d17be016 -> 2a16083502f3
INFO  [alembic.runtime.migration] Running upgrade 2a16083502f3 -> 2e5352a0ad4d
INFO  [alembic.runtime.migration] Running upgrade 2e5352a0ad4d -> 11926bcfe72d
INFO  [alembic.runtime.migration] Running upgrade 11926bcfe72d -> 4af11ca47297
INFO  [alembic.runtime.migration] Running upgrade 4af11ca47297 -> 1b294093239c
INFO  [alembic.runtime.migration] Running upgrade 1b294093239c -> 8a6d8bdae39
INFO  [alembic.runtime.migration] Running upgrade 8a6d8bdae39 -> 2b4c2465d44b
INFO  [alembic.runtime.migration] Running upgrade 2b4c2465d44b -> e3278ee65050
INFO  [alembic.runtime.migration] Running upgrade e3278ee65050 -> c6c112992c9
INFO  [alembic.runtime.migration] Running upgrade c6c112992c9 -> 5ffceebfada
INFO  [alembic.runtime.migration] Running upgrade 5ffceebfada -> 4ffceebfcdc
INFO  [alembic.runtime.migration] Running upgrade 4ffceebfcdc -> 7bbb25278f53
INFO  [alembic.runtime.migration] Running upgrade 7bbb25278f53 -> 89ab9a816d70
INFO  [alembic.runtime.migration] Running upgrade 89ab9a816d70 -> c879c5e1ee90
INFO  [alembic.runtime.migration] Running upgrade c879c5e1ee90 -> 8fd3918ef6f4
INFO  [alembic.runtime.migration] Running upgrade 8fd3918ef6f4 -> 4bcd4df1f426
INFO  [alembic.runtime.migration] Running upgrade 4bcd4df1f426 -> b67e765a3524
INFO  [alembic.runtime.migration] Running upgrade 5abc0278ca73 -> d3435b514502
INFO  [alembic.runtime.migration] Running upgrade d3435b514502 -> 30107ab6a3ee
INFO  [alembic.runtime.migration] Running upgrade 30107ab6a3ee -> c415aab1c048
INFO  [alembic.runtime.migration] Running upgrade c415aab1c048 -> a963b38d82f4
INFO  [alembic.runtime.migration] Running upgrade a963b38d82f4 -> 3d0e74aa7d37
INFO  [alembic.runtime.migration] Running upgrade 3d0e74aa7d37 -> 030a959ceafa
INFO  [alembic.runtime.migration] Running upgrade 030a959ceafa -> a5648cfeeadf
INFO  [alembic.runtime.migration] Running upgrade a5648cfeeadf -> 0f5bef0f87d4
INFO  [alembic.runtime.migration] Running upgrade 0f5bef0f87d4 -> 67daae611b6e
INFO  [alembic.runtime.migration] Running upgrade b67e765a3524 -> a84ccf28f06a
INFO  [alembic.runtime.migration] Running upgrade a84ccf28f06a -> 7d9d8eeec6ad
INFO  [alembic.runtime.migration] Running upgrade 67daae611b6e -> 6b461a21bcfc
INFO  [alembic.runtime.migration] Running upgrade 6b461a21bcfc -> 5cd92597d11d
INFO  [alembic.runtime.migration] Running upgrade 5cd92597d11d -> 929c968efe70
INFO  [alembic.runtime.migration] Running upgrade 929c968efe70 -> a9c43481023c
INFO  [alembic.runtime.migration] Running upgrade a9c43481023c -> 804a3c76314c
INFO  [alembic.runtime.migration] Running upgrade 804a3c76314c -> 2b42d90729da
INFO  [alembic.runtime.migration] Running upgrade 2b42d90729da -> 62c781cb6192
INFO  [alembic.runtime.migration] Running upgrade 62c781cb6192 -> c8c222d42aa9
INFO  [alembic.runtime.migration] Running upgrade c8c222d42aa9 -> 349b6fd605a6
INFO  [alembic.runtime.migration] Running upgrade 349b6fd605a6 -> 7d32f979895f
INFO  [alembic.runtime.migration] Running upgrade 7d32f979895f -> 594422d373ee
INFO  [alembic.runtime.migration] Running upgrade 594422d373ee -> 61663558142c
INFO  [alembic.runtime.migration] Running upgrade 61663558142c -> 867d39095bf4, port forwarding
INFO  [alembic.runtime.migration] Running upgrade 867d39095bf4 -> d72db3e25539, modify uniq port forwarding
INFO  [alembic.runtime.migration] Running upgrade d72db3e25539 -> cada2437bf41
INFO  [alembic.runtime.migration] Running upgrade cada2437bf41 -> 195176fb410d, router gateway IP QoS
INFO  [alembic.runtime.migration] Running upgrade 195176fb410d -> fb0167bd9639
INFO  [alembic.runtime.migration] Running upgrade fb0167bd9639 -> 0ff9e3881597
INFO  [alembic.runtime.migration] Running upgrade 0ff9e3881597 -> 9bfad3f1e780
INFO  [alembic.runtime.migration] Running upgrade 9bfad3f1e780 -> 63fd95af7dcd
INFO  [alembic.runtime.migration] Running upgrade 63fd95af7dcd -> c613d0b82681
INFO  [alembic.runtime.migration] Running upgrade c613d0b82681 -> c3e9d13c4367
INFO  [alembic.runtime.migration] Running upgrade c3e9d13c4367 -> 86274d77933e
INFO  [alembic.runtime.migration] Running upgrade 86274d77933e -> f4b9654dd40c
INFO  [alembic.runtime.migration] Running upgrade f4b9654dd40c -> a010322604bc
INFO  [alembic.runtime.migration] Running upgrade a010322604bc -> 263d454a9655
INFO  [alembic.runtime.migration] Running upgrade 263d454a9655 -> Ibac91d24da2
INFO  [alembic.runtime.migration] Running upgrade Ibac91d24da2 -> 2217c4222de6
INFO  [alembic.runtime.migration] Running upgrade 2217c4222de6 -> 18a7e90ae768
INFO  [alembic.runtime.migration] Running upgrade 18a7e90ae768 -> e4e236b0e1ff
INFO  [alembic.runtime.migration] Running upgrade e4e236b0e1ff -> e88badaa9591
INFO  [alembic.runtime.migration] Running upgrade e88badaa9591 -> d8bdf05313f4
INFO  [alembic.runtime.migration] Running upgrade 7d9d8eeec6ad -> a8b517cff8ab
INFO  [alembic.runtime.migration] Running upgrade a8b517cff8ab -> 3b935b28e7a0
INFO  [alembic.runtime.migration] Running upgrade 3b935b28e7a0 -> b12a3ef66e62
INFO  [alembic.runtime.migration] Running upgrade b12a3ef66e62 -> 97c25b0d2353
INFO  [alembic.runtime.migration] Running upgrade 97c25b0d2353 -> 2e0d7a8a1586
INFO  [alembic.runtime.migration] Running upgrade 2e0d7a8a1586 -> 5c85685d616d
  OK

#重启nova-api

systemctl restart openstack-nova-api.service
systemctl status openstack-nova-api.service

#服务初始化调用ml2_conf.ini中的配置,但指向/etc/neutron/olugin.ini文件

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

#重启neutron-server服务,并配置开机启动:

systemctl enable neutron-server.service
systemctl restart neutron-server.service
systemctl status neutron-server.service

9.6 部署与配置neutron agent - compute163/164

#由于这里做的是neutron server与neutron agent分离,所以采取这样的部署方式,常规的控制节点部署所有neutron的应用包括agent,计算节点部署只部署以下的neutron server、linuxbridge和nova配置即可,可参考Openstack-Ussuri-Neutron计算节点部署
#安装包

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

#备份neutron配置

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

#配置neutron配置文件,在对应项底下增加以下字段
#vim /etc/neutron/neutron.conf

[DEFAULT]
# ...
auth_strategy = keystone
transport_url = rabbit://rabbitmq:rabbitmq.123@controller160:5672,rabbitmq:rabbitmq.123@controller161:5672,rabbitmq:rabbitmq.123@controller162:5672
[database]
# ...
connection = mysql+pymysql://neutron:neutron.123@controller168/neutron
[keystone_authtoken]
# ...
www_authenticate_uri = http://controller168:5000
auth_url = http://controller168:5000
memcached_servers = controller160:11211,controller161:11211,controller162:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = neutron.123

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

#修改nova配置文件,在对应项底下增加以下字段
#vim /etc/nova/nova.conf

[neutron]
# ...
auth_url = http://controller168:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron.123

#重启nova-compute服务

systemctl restart openstack-nova-compute.service

#备份ml2配置

cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
egrep -v "^$|^#" /etc/neutron/plugins/ml2/ml2_conf.ini.bak >/etc/neutron/plugins/ml2/ml2_conf.ini

#配置ml2配置文件,在对应项底下增加以下字段
#vim /etc/neutron/plugins/ml2/ml2_conf.ini

[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

#备份linuxbridge_agent.ini配置

cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
egrep -v "^$|^#" /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak >/etc/neutron/plugins/ml2/linuxbridge_agent.ini

#配置linuxbridge_agent.ini文件,在对应项底下增加以下字段
#vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings = provider:eth1

[vxlan]
enable_vxlan = true
local_ip = 172.16.3.163
l2_population = true

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

#备份l3_agent.ini配置

cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
egrep -v "^$|^#" /etc/neutron/l3_agent.ini.bak >/etc/neutron/l3_agent.ini

#配置l3_agent.ini文件,在对应项底下增加以下字段
#vim /etc/neutron/l3_agent.ini

[DEFAULT]
# ...
interface_driver = linuxbridge

#备份dhcp_agent.ini配置

cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
egrep -v "^$|^#" /etc/neutron/dhcp_agent.ini.bak >/etc/neutron/dhcp_agent.ini

#配置dhcp_agent.ini文件,在对应项底下增加以下字段
#vim /etc/neutron/dhcp_agent.ini

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

#备份metadata_agent.ini配置

cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak
egrep -v "^$|^#" /etc/neutron/metadata_agent.ini.bak >/etc/neutron/metadata_agent.ini

#配置metadata_agent.ini文件,在对应项底下增加以下字段
#vim /etc/neutron/metadata_agent.ini

[DEFAULT]
# ...
nova_metadata_host = controller168
metadata_proxy_shared_secret = devops

#确保您的Linux操作系统内核支持网桥过滤器,通过验证所有下列sysctl值设置为1:

cat >> /etc/sysctl.conf <<EOF
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sysctl -p /etc/sysctl.conf

#重启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

9.7 neutron服务验证 - controller160

#加载管理凭证

source adminrc.sh

#执行network agent 检查

openstack network agent list

#输出

[root@controller160 ~]# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 12f5026f-2a62-49a2-8d87-ee0ca71688ea | Metadata agent     | compute163 | None              | :-)   | UP    | neutron-metadata-agent    |
| 7014261e-6719-447e-882a-19f45033a6c9 | Metadata agent     | compute164 | None              | :-)   | UP    | neutron-metadata-agent    |
| 767a9db2-7b3a-4edc-833a-39f4c3812b70 | DHCP agent         | compute163 | nova              | :-)   | UP    | neutron-dhcp-agent        |
| 8df5c9ee-8086-4351-8c66-866b2d2577fa | L3 agent           | compute164 | nova              | :-)   | UP    | neutron-l3-agent          |
| aa234650-cf75-4fe4-af48-0ea14495b1a6 | DHCP agent         | compute164 | nova              | :-)   | UP    | neutron-dhcp-agent        |
| b7cf0b1d-4ff0-4314-9427-8cfda3419e15 | Linux bridge agent | compute164 | None              | :-)   | UP    | neutron-linuxbridge-agent |
| c510acb9-7123-4ae3-850c-5e5184b6542a | Linux bridge agent | compute163 | None              | :-)   | UP    | neutron-linuxbridge-agent |
| dadea42c-e242-494a-a876-098cd71bcfc4 | L3 agent           | compute163 | nova              | :-)   | UP    | neutron-l3-agent          |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+

9.8 添加pcs资源

#在任意控制节点操作;
#添加资源neutron-server
#这里就没有添加neutron-agent,neutron-linuxbridge-agent,neutron-l3-agent,neutron-dhcp-agent与neutron-metadata-agent

pcs resource create neutron-server systemd:neutron-server clone interleave=true

#查看pcs资源

[root@controller160 ~]# pcs status
Cluster name: openstack-u-cluster
Cluster Summary:
  * Stack: corosync
  * Current DC: controller161 (version 2.0.3-5.el8_2.1-4b1f869f0f) - partition with quorum
  * Last updated: Sun Jun 21 23:37:12 2020
  * Last change:  Sun Jun 21 23:37:10 2020 by hacluster via crmd on controller160
  * 3 nodes configured
  * 25 resource instances configured

Node List:
  * Online: [ controller160 controller161 controller162 ]

Full List of Resources:
  * vip	(ocf::heartbeat:IPaddr2):	Started controller161
  * Clone Set: lb-haproxy-clone [lb-haproxy]:
    * Started: [ controller161 ]
    * Stopped: [ controller160 controller162 ]
  * Clone Set: openstack-keystone-clone [openstack-keystone]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: openstack-glance-api-clone [openstack-glance-api]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: openstack-nova-api-clone [openstack-nova-api]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: openstack-nova-scheduler-clone [openstack-nova-scheduler]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: openstack-nova-conductor-clone [openstack-nova-conductor]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: openstack-nova-novncproxy-clone [openstack-nova-novncproxy]:
    * Started: [ controller160 controller161 controller162 ]
  * Clone Set: neutron-server-clone [neutron-server]:
    * Started: [ controller160 controller161 controller162 ]

至此,neutron控制节点服务已部署完毕,如有问题请联系我改正,感激不尽!

8.x 部署过程遇到的问题汇总

eg1. oslo_db.exception.DBError: (pymysql.err.InternalError) (1832, "Cannot change column 'network_id': used in a foreign key constraint 'subnets_ibfk_1'")
[SQL: ALTER TABLE subnets MODIFY network_id VARCHAR(36) NOT NULL]
解决方案:
root@controller160:~# mysql -uroot -p
MariaDB [(none)]> use neutron;
MariaDB [(none)]> ALTER TABLE subnets DROP FOREIGN KEY subnets_ibfk_1;
Query OK, 0 rows affected (0.15 sec)
Records: 0  Duplicates: 0  Warnings: 0

eg2.[root@compute163 ~]# sysctl -p /etc/sysctl.conf
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory
解决方案:
[root@compute163 ~]# modprobe br_netfilter
[root@compute163 ~]# ls /proc/sys/net/bridge
bridge-nf-call-arptables  bridge-nf-call-ip6tables  bridge-nf-call-iptables  bridge-nf-filter-pppoe-tagged  bridge-nf-filter-vlan-tagged  bridge-nf-pass-vlan-input-dev
[root@compute163 ~]# sysctl -p
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1

你可能感兴趣的:(9 Openstack-Ussuri-Neutron控制/计算节点集群部署-centos8)