OpenStack Yoga版安装笔记(十三)neutron安装

news2024/11/16 12:27:15

1、官方文档

OpenStack Installation Guideicon-default.png?t=O83Ahttps://docs.openstack.org/install-guide/

本次安装是在Ubuntu 22.04上进行,基本按照OpenStack Installation Guide顺序执行,主要内容包括:

  • 环境安装 (已完成)
  • OpenStack服务安装
    • keyston安装(已完成)
    • glance安装 (已完成)
    • placement安装(已完成) 
    • nova安装(已安装)
    • neutron安装(本篇文档安装)◄──
  • 启动一个实例

参考OpenStack Yoga版最小化部署(Minimal deployment for Yoga),顺序安装必须的核心服务,本次安装neutron服务。

2、Networking service overview

OpenStack Networking(也称为Neutron)是OpenStack云计算平台中负责网络服务的组件,它允许你创建并附加由其他OpenStack服务管理的接口设备到网络中(原文:OpenStack Networking (neutron) allows you to create and attach interface devices managed by other OpenStack services to networks.)。使用不同的插件(Plug-in)来适应不同的网络设备和软件,这为OpenStack的架构和部署提供了灵活性。

具体来说:

  1. 创建和附加接口设备:Neutron允许你创建虚拟接口(如虚拟网卡),并将这些接口附加到虚拟机或其他虚拟设备上,使它们能够连接到虚拟网络。

  2. 由其他OpenStack服务管理:在OpenStack环境中,不同的服务可能需要管理网络接口。例如,计算服务(Nova)可能会创建和管理虚拟机的网络接口,而Neutron则负责网络的配置和路由。

  3. 插件实现:Neutron的设计允许通过插件来扩展其功能。这些插件可以是第三方开发的,用于支持不同的网络硬件和软件。

  4. 适应不同的网络设备和软件:通过使用不同的插件,Neutron可以适应各种网络环境,无论是传统的物理网络设备还是现代的软件定义网络(SDN)解决方案。

  5. 提供灵活性:这种插件架构为OpenStack的架构和部署提供了灵活性。用户可以根据他们的需求选择合适的网络插件,以实现特定的网络功能和性能要求。

总的来说,OpenStack Networking (Neutron) 提供了一个可扩展的网络服务,它通过插件支持多种网络技术和设备,使得OpenStack能够在各种网络环境中灵活部署和运行。

OpenStack Networking(Neutron)包括以下组件:

  1. neutron-server:接受并路由API请求到适当的OpenStack Networking插件进行处理。

  2. OpenStack Networking 插件和代理(plug-in and agent):功能有:插拔端口,创建网络或子网,并提供IP地址分配。这些插件和代理根据特定云环境中使用的供应商和技术而有所不同。OpenStack Networking自带了适用于Cisco虚拟和物理交换机、NEC OpenFlow产品、Open vSwitch、Linux桥接以及VMware NSX产品的插件和代理

  3. 常见的代理:包括L3(第三层)代理、DHCP(动态主机IP地址分配)代理以及插件代理。

  4. 消息队列:大多数OpenStack Networking安装使用它来在neutron-server和各种代理之间路由信息。它还充当数据库,存储特定插件的网络状态。

OpenStack Networking主要与OpenStack Compute交互,为其实例提供网络和连接性。

3、Networking (neutron) concepts

Neutron管理的范围,包括所有虚拟网络(Virtual Network Infrastructure,VNI),以及虚拟网络接入物理网络的部分(可理解为access layer of physical network)。通过Neutron,可以在租户内部(Project内部)创建完整的网络拓扑,还可以包括Firewall、VPN等安全服务。

  1. 网络、子网和路由器(Network、subnet、router):Neutron 提供了网络、子网和路由器的对象抽象。这些抽象具有与其物理对应物类似的功能。例如,网络包含子网,路由器在不同的子网和网络之间路由流量。

  2. 外部网络(external network:每个 Neutron 设置至少有一个外部网络。与其它虚拟定义的网络不同,外部网络代表了 实际可访问的物理网络的一部分。外部网络上的 IP 地址可以被外部访问。内部网络(即虚拟网络)通过外部网络和外部通讯。

  3. 内部网络(internal network:除了外部网络,任何 Neutron 设置还有多个内部网络。这些软件定义的网络直接连接到虚拟机(VM)。只有在同一内部网络上的 VM,或者通过接口连接到相同路由器的子网上的 VM,才能直接访问该网络上的 VM。

  4. 路由器和网络访问(router):为了使外部网络能够访问 VM,以及 VM 能够访问外部网络,需要在网络之间设置路由器。路由器可以和外部网络连接(就是说路由器上可以通过路由指向外部网络),路由器同时和内部网络连接。与物理路由器一样,子网可以访问连接到同一路由器的其他子网上的虚拟机,虚拟机也可以通过路由器访问外部网络。

  5. 端口和 IP 地址分配(port:你可以在外部网络上为内部网络的端口分配 IP 地址。当某物连接到子网时,该连接被称为端口(原文:Whenever something is connected to a subnet, that connection is called a port.) 。你可以将外部网络的 IP 地址与 VM 的端口关联起来,这样外部网络的实体就可以访问 VM。

  6. 安全组(security group:Neutron 还支持安全组。安全组允许管理员以组的形式定义防火墙规则。VM 可以属于一个或多个安全组,Neutron 将这些安全组中的规则应用于 VM,以阻止或允许端口、端口范围或流量类型。

  7. 插件(plug-in:每个 Neutron 使用的插件都有自己的概念。虽然这些概念对于操作 VNI 和 OpenStack 环境不是必需的,但理解它们可以帮助你设置 Neutron。所有 Neutron 安装都使用一个核心插件和一个安全组插件(或仅使用 No-Op 安全组插件)。

4、网络拓扑

提供两种网络拓扑方案。

4.1 Provider networks

创建网络过程中,会创建bridge(用于二层网络通讯)实际的bridge是按需产生的,在创建虚机的过程中,根据虚机的信息按需创建bridge,以节约主机资源),bridge会和物理端口绑定(至于和哪个物理端口绑定,需在neutron配置文件在通过provider network来设置相应的物理端口)。

相同网段虚机之间通讯,依赖简单的二层网络进行通讯(比如:vm1 - br1 -- br2 --vm2)。

不同网段虚机之间通讯,需依赖外部的router(具备三层路由功能的设备即可)进行通讯(比如vm1的网关设置在外部的Router上)。

Provider networks的示意图如下:

4.2 Self-service networks

创建网络过程中,会创建bridgebridge会创建vxlan端口,用于跨越三层的vxlan通讯;同时会创建router,用于三层网络通讯,从而大大提高了组网的灵活性。

相同网段虚机之间通讯,依赖二层over三层的vxlan进行overlay层面的二层网络进行通讯(比如vm1 -——br3 -vxlan——br4-vxlan-int1 ——vm2)。在这里,使用ens33的端口作为vxlan的vtep地址

不同网段虚机之间通讯,可以使用创建的Router(图中的Router2)进行三层网络通讯,比如vm2的网关设置在Router2上,vm2去往外部的流量,首先发送到网关上(Router2),然后由Router2执行三层路由功能,发往外部,比如Router1。

Self-service networks的示意图如下:

这些功能会在后续安装过程中,通过实验环境进行说明。

在接下来的安装过程中,首先进行Provider networks网络的安装,然后创建虚机。

5、Controller node补充安装compute服务

之前只在compute1上安装了compute服务,为了后续测试需要,在controller node上安装compute服务,这样也可以在controller node上创建虚机。

1、安装软件包。

root@controller:~# apt install nova-compute

2、/etc/nova/nova.conf不需要修改。

3、加入cell database。

root@controller ~(admin/amdin)# openstack compute service list --service nova-compute
+--------------------------------------+--------------+------------+------+---------+-------+----------------------------+
| ID                                   | Binary       | Host       | Zone | Status  | State | Updated At                 |
+--------------------------------------+--------------+------------+------+---------+-------+----------------------------+
| c04e53a4-fdb8-4915-9b1a-f5d195e753c4 | nova-compute | compute1   | nova | enabled | up    | 2024-09-20T14:39:38.000000 |
| b3d4e71d-088a-4249-8d8f-e6d8528c698d | nova-compute | controller | nova | enabled | up    | 2024-09-20T14:39:41.000000 |
+--------------------------------------+--------------+------------+------+---------+-------+----------------------------+
root@controller ~(admin/amdin)# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Modules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3. This warning can usually be ignored if the caller is only importing and not executing nova code.
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 8b1967df-7901-42b3-8b03-fc4e884f490d
Checking host mapping for compute host 'controller': 027eb56f-a860-41b8-afa3-91b65f1c8777
Creating host mapping for compute host 'controller': 027eb56f-a860-41b8-afa3-91b65f1c8777
Found 1 unmapped computes in cell: 8b1967df-7901-42b3-8b03-fc4e884f490d
root@controller ~(admin/amdin)# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Modules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3. This warning can usually be ignored if the caller is only importing and not executing nova code.
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 8b1967df-7901-42b3-8b03-fc4e884f490d
Found 0 unmapped computes in cell: 8b1967df-7901-42b3-8b03-fc4e884f490d
root@controller ~(admin/amdin)# 

root@controller ~(admin/amdin)# openstack service list
+----------------------------------+-----------+-----------+
| ID                               | Name      | Type      |
+----------------------------------+-----------+-----------+
| 1b8f162ebcf848ee8bd69bc6b36a8dff | nova      | compute   |
| 639145725f804482a50d4740b0c79c43 | placement | placement |
| 75fe01049ec648b69e48d200971bf601 | keystone  | identity  |
| d6a3dadf92e542289c5ebd37e3553cdd | glance    | image     |
+----------------------------------+-----------+-----------+
root@controller ~(admin/amdin)# openstack compute service list
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| ID                                   | Binary         | Host       | Zone     | Status  | State | Updated At                 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| b935d869-0102-45c0-8b24-e338c5606890 | nova-scheduler | controller | internal | enabled | up    | 2024-09-20T14:42:08.000000 |
| e4929b42-af08-449f-b703-c0fc36c4220b | nova-conductor | controller | internal | enabled | up    | 2024-09-20T14:42:04.000000 |
| c04e53a4-fdb8-4915-9b1a-f5d195e753c4 | nova-compute   | compute1   | nova     | enabled | up    | 2024-09-20T14:42:08.000000 |
| b3d4e71d-088a-4249-8d8f-e6d8528c698d | nova-compute   | controller | nova     | enabled | up    | 2024-09-20T14:42:01.000000 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
root@controller ~(admin/amdin)#

6、安装neutron服务(Install and configure for Ubuntu)

6.1 Install and configure controller node

6.1.1 Prerequisites

1、database操作

root@controller:~# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 185
Server version: 10.6.18-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
MariaDB [(none)]> CREATE DATABASE neutron;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
    ->   IDENTIFIED BY 'openstack';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
    ->   IDENTIFIED BY 'openstack';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> quit
Bye
root@controller:~# 

2、keystone操作

创建neutron用户,添加neutron用户在project service中的admin role的角色(即授权)。

创建network service的服务访问点。

root@controller:~# cat admin-openrc 
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export PS1='\u@\h \W(admin/amdin)\$ '
root@controller:~# 
root@controller:~# source admin-openrc 
root@controller ~(admin/amdin)# openstack user create --domain default --password-prompt neutron
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | b0eb41c181c04fe8b4bc7ca8e3adbbfc |
| name                | neutron                          |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
root@controller ~(admin/amdin)# 
root@controller ~(admin/amdin)# openstack role add --project service --user neutron admin
root@controller ~(admin/amdin)# openstack service create --name neutron \
>   --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | 3df6f54ee6174d93bcabce96a06789d1 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
root@controller ~(admin/amdin)# 
root@controller ~(admin/amdin)# openstack endpoint create --region RegionOne \
>   network public http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 65b3b976624145db9e0737643e2a4d2b |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3df6f54ee6174d93bcabce96a06789d1 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
root@controller ~(admin/amdin)# openstack endpoint create --region RegionOne \
>   network internal http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d01bada60da84d28afb07f28c72fe847 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3df6f54ee6174d93bcabce96a06789d1 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
root@controller ~(admin/amdin)# openstack endpoint create --region RegionOne \
>   network admin http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | c54af128bb1a47198bd1d831a5663221 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 3df6f54ee6174d93bcabce96a06789d1 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
root@controller ~(admin/amdin)# 

6.1.2 Networking Option 1: Provider networks

先根据Provider networks选项进行网络服务的安装。

1、安装软件包

(controller执行)
# apt install neutron-server neutron-plugin-ml2 \
  neutron-linuxbridge-agent neutron-dhcp-agent \
  neutron-metadata-agent

2、vi /etc/neutron/neutron.conf

---

[database]
# connection = sqlite:var/lib/neutron/neutron.sqlite
connection = mysql+pymysql://neutron:openstack@controller/neutron

---

[DEFAULT]
core_plugin = ml2
service_plugins =

---

[DEFAULT]

transport_url = rabbit://openstack:openstack@controller

---

[DEFAULT]

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 = openstack


---

[DEFAULT]

notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

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

---

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

3、vi /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security

[ml2_type_flat]
flat_networks = provider

[securitygroup]
enable_ipset = true

4、vi  /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings = provider:ens34

[vxlan]
enable_vxlan = false


[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
  1. physical_interface_mappings = provider:ens34 这一行指定了物理网络接口与提供给虚拟网络的映射关系。在这里,provider 是一个虚拟网络的标识符,而 ens34 是服务器上的一个物理网络接口卡(NIC)的名称。这意味着所有标记为 provider 网络的流量都将通过 ens34 这个物理接口传输。

  2. enable_security_group = true 这一行启用了安全组功能。安全组是 Neutron 提供的一种虚拟防火墙,用于控制进出虚拟机实例的网络流量。启用后,用户可以定义一系列的规则来允许或拒绝特定类型的流量。

  3. firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver 这一行指定了用于实现安全组规则的防火墙驱动程序。在这里,它设置为使用基于 iptables 的防火墙驱动程序,这意味着 Neutron 将通过 iptables 规则来控制虚拟机实例的网络访问控制 

network bridge filters开启:

root@controller:~# sysctl net.bridge.bridge-nf-call-iptables
net.bridge.bridge-nf-call-iptables = 1
root@controller:~# sysctl net.bridge.bridge-nf-call-ip6tables
net.bridge.bridge-nf-call-ip6tables = 1
root@controller:~# 

5、vi /etc/neutron/dhcp_agent.ini

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

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq 这一行定义了 DHCP 服务的驱动程序。DHCP(动态主机配置协议)用于自动分配 IP 地址给网络中的设备。在这里,它设置为使用 Dnsmasq,这是一个轻量级的 DHCP 服务器,它也提供了 DNS 缓存和转发功能。Neutron 通过 Dnsmasq 为虚拟网络中的虚拟机提供 IP 地址配置

6.1.3 Configure the metadata agent

root@controller:~# vi /etc/neutron/metadata_agent.ini

[DEFAULT]
nova_metadata_host = controller
metadata_proxy_shared_secret = openstack

6.1.4 Configure the Compute service to use the Networking service

root@controller:~# vi /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 = openstack
service_metadata_proxy = true
metadata_proxy_shared_secret = openstack

6.1.5 Finalize installation

root@controller:~# 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 97c25b0d2353 -> 2e0d7a8a1586
INFO  [alembic.runtime.migration] Running upgrade 2e0d7a8a1586 -> 5c85685d616d
  OK
root@controller:~# 
root@controller:~# service nova-api restart
root@controller:~# service neutron-server restart
root@controller:~# service neutron-linuxbridge-agent restart
root@controller:~# service neutron-dhcp-agent restart
root@controller:~# service neutron-metadata-agent restart
root@controller:~# 

6.2 Install and configure compute node

6.2.1 安装软件包

root@compute1:~# apt install neutron-linuxbridge-agent

6.2.2 Configure the common component

root@compute1:~# vi /etc/neutron/neutron.conf

[database]
# connection = sqlite:var/lib/neutron/neutron.sqlite
transport_url = rabbit://openstack:openstack@controller  //后面发现这里配置错了,见后面问题解决。

---

[DEFAULT]
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 = openstack

---

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

---

6.2.3 Networking Option 1: Provider networks

root@compute1:~# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]
physical_interface_mappings = provider:ens34 //后面发现应该是ens35

---
[vxlan]
enable_vxlan = false

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

---

network bridge filters: 

root@compute1:~# sysctl net.bridge.bridge-nf-call-iptables
net.bridge.bridge-nf-call-iptables = 1
root@compute1:~# sysctl net.bridge.bridge-nf-call-ip6tables
net.bridge.bridge-nf-call-ip6tables = 1
root@compute1:~# 

6.2.4 Configure the Compute service to use the Networking service

root@compute1:~# vi /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 = openstack
#

6.2.5 Finalize installation

root@compute1:~# service nova-compute restart
root@compute1:~# service neutron-linuxbridge-agent restart
root@compute1:~#

7、Verify operation

root@osclient:~# source admin-openrc 
root@osclient ~(admin/amdin)# openstack extension list --network
+----------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Name                                                                                                                                                           | Alias                                | Description                                                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Address group                                                                                                                                                  | address-group                        | Support address group                                                                                                                                    |
| Address scope                                                                                                                                                  | address-scope                        | Address scopes extension.                                                                                                                                |
| agent                                                                                                                                                          | agent                                | The agent management extension.                                                                                                                          |
| Agent's Resource View Synced to Placement                                                                                                                      | agent-resources-synced               | Stores success/failure of last sync to Placement                                                                                                         |
| Allowed Address Pairs                                                                                                                                          | allowed-address-pairs                | Provides allowed address pairs                                                                                                                           |
| Availability Zone                                                                                                                                              | availability_zone                    | The availability zone extension.                                                                                                                         |
| Availability Zone Filter Extension                                                                                                                             | availability_zone_filter             | Add filter parameters to AvailabilityZone resource

...                                             

问题及解决

1、查看network agent,发现compute1的bridge agent没有发现:

root@osclient ~(admin/amdin)# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 4516d406-7b90-4029-93a9-6a7fbe964bc2 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
| dd50147c-5a72-4386-9073-a4431c47a3b4 | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
| fc147e91-1504-4a3c-8709-0665c97b4cb6 | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
root@osclient ~(admin/amdin)# 

2、查看进程,发现cleanup工作不正常:

root@compute1:~# systemctl | grep neutron
  neutron-linuxbridge-agent.service                                                                loaded active     running         Openstack Neutron Linux Bridge Agent
  neutron-linuxbridge-cleanup.service                                                              loaded activating start     start OpenStack Neutron Linux bridge cleanup
root@compute1:~# 

3、查看日志,发现ens34不存在,检查后,应该是ens35:

root@compute1:/var/log/neutron# tail neutron-linuxbridge-cleanup.log 
2024-09-21 03:46:09.365 6145 INFO neutron.common.config [-] /usr/bin/neutron-linuxbridge-cleanup version 20.5.0
2024-09-21 03:46:09.366 6145 INFO neutron.cmd.linuxbridge_cleanup [-] Interface mappings: {'provider': 'ens34'}.
2024-09-21 03:46:09.366 6145 INFO neutron.cmd.linuxbridge_cleanup [-] Bridge mappings: {}.
2024-09-21 03:46:09.366 6145 INFO oslo.privsep.daemon [-] Running privsep helper: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'privsep-helper', '--config-file', '/etc/neutron/neutron.conf', '--config-file', '/etc/neutron/plugins/ml2/linuxbridge_agent.ini', '--privsep_context', 'neutron.privileged.default', '--privsep_sock_path', '/tmp/tmpt3t6tqyi/privsep.sock']
2024-09-21 03:46:10.040 6145 INFO oslo.privsep.daemon [-] Spawned new privsep daemon via rootwrap
2024-09-21 03:46:09.932 6168 INFO oslo.privsep.daemon [-] privsep daemon starting
2024-09-21 03:46:09.936 6168 INFO oslo.privsep.daemon [-] privsep process running with uid/gid: 0/0
2024-09-21 03:46:09.937 6168 INFO oslo.privsep.daemon [-] privsep process running with capabilities (eff/prm/inh): CAP_DAC_OVERRIDE|CAP_DAC_READ_SEARCH|CAP_NET_ADMIN|CAP_SYS_ADMIN|CAP_SYS_PTRACE/CAP_DAC_OVERRIDE|CAP_DAC_READ_SEARCH|CAP_NET_ADMIN|CAP_SYS_ADMIN|CAP_SYS_PTRACE/none
2024-09-21 03:46:09.938 6168 INFO oslo.privsep.daemon [-] privsep daemon running as pid 6168
2024-09-21 03:46:10.527 6145 ERROR neutron.plugins.ml2.drivers.linuxbridge.agent.linuxbridge_neutron_agent [-] Interface ens34 for physical network provider does not exist. Agent terminated!
root@compute1:/var/log/neutron# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:51:16:68 brd ff:ff:ff:ff:ff:ff
    altname enp2s0
    inet 10.0.20.12/24 brd 10.0.20.255 scope global ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe51:1668/64 scope link 
       valid_lft forever preferred_lft forever
3: ens35: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:0c:29:51:16:72 brd ff:ff:ff:ff:ff:ff
    altname enp2s3
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:db:70:49 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever

4、修改配置文件:

root@compute1:/var/log/neutron# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini 

[linux_bridge]
physical_interface_mappings = provider:ens35

5、重启服务,然后检查:

root@compute1:/var/log/neutron# service nova-compute restart
root@compute1:/var/log/neutron# service neutron-linuxbridge-agent restart

root@compute1:/var/log/neutron# systemctl | grep neutron
  neutron-linuxbridge-agent.service                                                                loaded active running   Openstack Neutron Linux Bridge Agent
  neutron-linuxbridge-cleanup.service                                                              loaded active exited    OpenStack Neutron Linux bridge cleanup
root@compute1:/var/log/neutron# 

root@compute1:/var/log/neutron# tail neutron-linuxbridge-cleanup.log              
2024-09-21 03:50:42.556 8781 INFO neutron.common.config [-] /usr/bin/neutron-linuxbridge-cleanup version 20.5.0
2024-09-21 03:50:42.556 8781 INFO neutron.cmd.linuxbridge_cleanup [-] Interface mappings: {'provider': 'ens35'}.
2024-09-21 03:50:42.556 8781 INFO neutron.cmd.linuxbridge_cleanup [-] Bridge mappings: {}.
2024-09-21 03:50:42.557 8781 INFO oslo.privsep.daemon [-] Running privsep helper: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'privsep-helper', '--config-file', '/etc/neutron/neutron.conf', '--config-file', '/etc/neutron/plugins/ml2/linuxbridge_agent.ini', '--privsep_context', 'neutron.privileged.default', '--privsep_sock_path', '/tmp/tmppao22jjf/privsep.sock']
2024-09-21 03:50:43.285 8781 INFO oslo.privsep.daemon [-] Spawned new privsep daemon via rootwrap
2024-09-21 03:50:43.165 8802 INFO oslo.privsep.daemon [-] privsep daemon starting
2024-09-21 03:50:43.169 8802 INFO oslo.privsep.daemon [-] privsep process running with uid/gid: 0/0
2024-09-21 03:50:43.171 8802 INFO oslo.privsep.daemon [-] privsep process running with capabilities (eff/prm/inh): CAP_DAC_OVERRIDE|CAP_DAC_READ_SEARCH|CAP_NET_ADMIN|CAP_SYS_ADMIN|CAP_SYS_PTRACE/CAP_DAC_OVERRIDE|CAP_DAC_READ_SEARCH|CAP_NET_ADMIN|CAP_SYS_ADMIN|CAP_SYS_PTRACE/none
2024-09-21 03:50:43.171 8802 INFO oslo.privsep.daemon [-] privsep daemon running as pid 8802
2024-09-21 03:50:43.779 8781 INFO neutron.cmd.linuxbridge_cleanup [-] Linux bridge cleanup completed successfully

6、但还是不能发现compute1的bridge agent:

root@osclient ~(admin/amdin)# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 4516d406-7b90-4029-93a9-6a7fbe964bc2 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
| dd50147c-5a72-4386-9073-a4431c47a3b4 | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
| fc147e91-1504-4a3c-8709-0665c97b4cb6 | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
root@osclient ~(admin/amdin)# 

7、检查compute1的日志

root@compute1:/var/log/neutron# tail neutron-linuxbridge-agent.log 
2024-09-21 03:53:30.423 8873 ERROR oslo.messaging._drivers.impl_rabbit [req-1c74e7d2-af9b-486d-b776-8e11ab0d3d5f - - - - -] Connection failed: [Errno 111] ECONNREFUSED (retrying in 17.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:53:30.424 8873 ERROR oslo.messaging._drivers.impl_rabbit [-] Connection failed: [Errno 111] ECONNREFUSED (retrying in 17.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:53:47.453 8873 ERROR oslo.messaging._drivers.impl_rabbit [-] Connection failed: [Errno 111] ECONNREFUSED (retrying in 19.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:53:47.453 8873 ERROR oslo.messaging._drivers.impl_rabbit [req-1c74e7d2-af9b-486d-b776-8e11ab0d3d5f - - - - -] Connection failed: [Errno 111] ECONNREFUSED (retrying in 19.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:06.486 8873 ERROR oslo.messaging._drivers.impl_rabbit [req-1c74e7d2-af9b-486d-b776-8e11ab0d3d5f - - - - -] Connection failed: [Errno 111] ECONNREFUSED (retrying in 21.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:06.487 8873 ERROR oslo.messaging._drivers.impl_rabbit [-] Connection failed: [Errno 111] ECONNREFUSED (retrying in 21.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:27.522 8873 ERROR oslo.messaging._drivers.impl_rabbit [req-1c74e7d2-af9b-486d-b776-8e11ab0d3d5f - - - - -] Connection failed: [Errno 111] ECONNREFUSED (retrying in 23.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:27.522 8873 ERROR oslo.messaging._drivers.impl_rabbit [-] Connection failed: [Errno 111] ECONNREFUSED (retrying in 23.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:50.560 8873 ERROR oslo.messaging._drivers.impl_rabbit [-] Connection failed: [Errno 111] ECONNREFUSED (retrying in 25.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
2024-09-21 03:54:50.561 8873 ERROR oslo.messaging._drivers.impl_rabbit [req-1c74e7d2-af9b-486d-b776-8e11ab0d3d5f - - - - -] Connection failed: [Errno 111] ECONNREFUSED (retrying in 25.0 seconds): ConnectionRefusedError: [Errno 111] ECONNREFUSED
root@compute1:/var/log/neutron# 

从日志信息来看,neutron-linuxbridge-agent 正在尝试连接到 RabbitMQ 消息代理,但是连接失败了,错误代码为 ECONNREFUSED。这通常意味着 RabbitMQ 服务没有在预期的端口上监听,或者网络问题阻止了连接。

8、检查配置,发现配置错误,mq配置到[database]下面了,应该在[default]下面:

 root@compute1:/var/log/neutron# vi /etc/neutron/neutron.conf

[DEFAULT]
core_plugin = ml2

transport_url = rabbit://openstack:openstack@controller

9、重启服务后,工作正常了。

root@compute1:/var/log/neutron# service nova-compute restart
root@compute1:/var/log/neutron# service neutron-linuxbridge-agent restart

root@osclient ~(admin/amdin)# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 4516d406-7b90-4029-93a9-6a7fbe964bc2 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
| dd50147c-5a72-4386-9073-a4431c47a3b4 | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
| f05c0a19-5657-4e12-8f4c-f5ea5dfc7043 | Linux bridge agent | compute1   | None              | :-)   | UP    | neutron-linuxbridge-agent |
| fc147e91-1504-4a3c-8709-0665c97b4cb6 | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
root@osclient ~(admin/amdin)# 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2154335.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

VS2022中的调试

目录 前言&#xff1a; 使用&#xff1a; 调试&#xff1a; 前言&#xff1a; 在日益繁忙的工作环境中&#xff0c;选择合适的编程工具已成为提升开发者工作效率的关键。不同的工具能够帮助我们简化代码编写、自动化任务、提升调试速度&#xff0c;甚至让团队协作更加顺畅。…

【Linux学习】基本指令其一

命令行界面 命令行终端是一个用户界面&#xff0c;允许用户通过输入文本命令与计算机系统进行交互。 比如Windows下&#xff0c; 键入winR&#xff0c;然后输入cmd&#xff0c;就可以输入文本指令与操作系统交互了。 Windows有另一个命令行界面Powershell,它的功能比cmd更强大…

关于有源蜂鸣器及无源蜂鸣器的区别及驱动各类单片机案例

关于有源蜂鸣器及无源蜂鸣器的区别及驱动各类单片机案例 有源蜂鸣器与无源蜂鸣器区别有源蜂鸣器无源蜂鸣器模块化有源蜂鸣器及无源蜂鸣器驱动方式的说明 有源、无源蜂鸣器代码驱动总结 有源蜂鸣器与无源蜂鸣器区别 有源蜂鸣器与无源蜂鸣器区别在于是否有振荡源。 有源蜂鸣器即…

Redis——redispluspls库通用命令以及String类型相关接口使用

文章目录 通用命令get&#xff0c;setkeys插入迭代器 expire和ttltype string 类型接口set和getset NX和XXmset 和 mgetgetrange 和 setrangeincr 和 decr 通用命令 get&#xff0c;set void get_set_test(sw::redis::Redis& redis){//bool set(const sw::redis::StringV…

Hadoop的安装

文章目录 一. 到Hadoop官网下载安装文件hadoop-3.4.0.tar.gz。二. 环境变量三. 配置 一. 到Hadoop官网下载安装文件hadoop-3.4.0.tar.gz。 随后点击下载即可 由于Hadoop不直接支持Windows系统&#xff0c;因此&#xff0c;需要修改一些配置才能运行 二. 环境变量 三. 配置 进…

《飞机大战游戏》实训项目(Java GUI实现)(设计模式)(简易)

目录 一、最终实现后&#xff0c;效果如下。 &#xff08;1&#xff09;简单介绍本游戏项目&#xff08;待完善&#xff09; &#xff08;2&#xff09;运行效果图&#xff08;具体大家自己可以试&#xff09; 初始运行情况。 手动更换背景图。 通过子弹攻击敌机&#xff0c;累…

如何在Mac上查看剪贴板历史记录

重点摘要 macOS 内建的剪贴簿查看器可以透过 Finder 存取,但只能显示最近一次复制的内容,而且重新开机后就会清除。若要更进阶的剪贴簿管理,第三方 app 像是 CleanClip 提供了强大的功能和更好的组织方式。CleanClip 提供了全方位的剪贴簿历史管理解决方案,支援各种内容类型和…

HarmonyOS鸿蒙开发实战(5.0)表情图片聊天案例实践

鸿蒙HarmonyOS NEXT开发实战往期文章必看&#xff08;持续更新......&#xff09; HarmonyOS NEXT应用开发性能实践总结 HarmonyOS NEXT应用开发案例实践总结合集 最新版&#xff01;“非常详细的” 鸿蒙HarmonyOS Next应用开发学习路线&#xff01;&#xff08;从零基础入门…

线性表一(vector)

#include<bits/stdc.h> using namespace std; vector<int> a(5,2);//定义一个初始长度为5&#xff0c;每个元素值为2的可变数组 vector<char> b(3);//定义一个初始长度为3&#xff0c;每个元素为默认值的可变数组 vector<int> v;//定义一个长度为0的可…

mxnet系统架构

mxnet系统架构 MXNet 是一个高性能、灵活的深度学习框架&#xff0c;最早由李沐&#xff08;Mu Li&#xff09;等人开发&#xff0c;并且得到了 Amazon 的支持。它支持多种语言&#xff08;包括 Python、Scala、C、R、Julia、Perl 等&#xff09;&#xff0c;并以其灵活的编程…

【保奖思路】2024年华为杯研赛B题完整代码建模过程(后续会更新)

您的点赞收藏是我继续更新的最大动力&#xff01; 一定要点击如下的卡片&#xff0c;那是获取资料的入口&#xff01; 点击链接加入【2024华为杯研赛资料汇总】&#xff1a;https://qm.qq.com/q/XzdIsvbiM0https://qm.qq.com/q/XzdIsvbiM0请根据附件WLAN网络实测训练集中所提供…

python多继承 - 子类指定父类

菜鸟教程-面向对象 https://www.runoob.com/python3/python3-class.html 子类内指定父类 父类名称.__init__(self,参数1&#xff0c;参数2&#xff0c;...) 子类对象指定父类 class Parent1:def my_method(self):print("Parent1s my_method")class Parent2:def my_…

基于uni-app的计算机类面试宝设计与实现(毕业论文)

目 录 1 前言 1 1.1 研究目的与意义 1 1.2 研究现状 1 1.3 论文结构 2 2 可行性分析 3 2.1 经济可行性 3 2.2 法律可行性 3 2.3 技术可行性 4 2.4 市场可行性 4 2.5 可行性分析结论 4 3 系统需求分析 4 3.1 用户需求分析 4 3.2 系统功能分析 5 3.3 系统性能需求分析 6 4 概要设…

前端vue-ref与document.querySelector的对比

ref只在本组件中查找&#xff0c;而document.querySelector是在整个页面查找

【学习笔记】手写Tomcat 四

目录 一、Read 方法返回 -1 的问题 二、JDBC 优化 1. 创建配置文件 2. 创建工具类 3. 简化 JDBC 的步骤 三、修改密码 优化返回数据 创建修改密码的页面 注意 测试 四、优化响应动态资源 1. 创建 LoginServlet 类 2. 把登录功能的代码放到 LoginServlet 类 3. 创…

hackmyvm靶场--zon

环境 攻击机kali 靶机 未知 主机探测 因为在同一个局域网内使用ARP协议探测存活主机 靶机为192.168.56.128 端口探测 常见的80和22端口 那么一定是寻找web漏洞拿shell了 后台扫描 后台扫描常用dirsearch和gobuster,有时候小字典可能不太行&#xff0c;可以尝试换个大点…

Android SystemUI组件(07)锁屏KeyguardViewMediator分析

该系列文章总纲链接&#xff1a;专题分纲目录 Android SystemUI组件 本章关键点总结 & 说明&#xff1a; 说明&#xff1a;本章节持续迭代之前章节的思维导图&#xff0c;主要关注左侧上方锁屏分析部分即可。 为了更好理解本文的内容&#xff0c;优先说明下SystemUI中与Ke…

电力行业螺钉螺帽螺丝缺失检测数据集 voc yol

电力行业螺钉螺帽螺丝缺失检测数据集 数据集描述 该数据集旨在用于电力行业中的螺钉、螺帽、螺丝等紧固件的缺失检测任务。数据集包含了大量的图像及其对应的标注信息&#xff0c;可用于训练计算机视觉模型&#xff0c;以识别和定位电力设施中的螺钉、螺帽、螺丝等部件是否存在…

Go-知识-定时器

Go-知识-定时器 1. 介绍2. Timer使用场景2.1 设定超时时间2.2 延迟执行某个方法 3. Timer 对外接口3.1 创建定时器3.2 停止定时器3.3 重置定时器3.4 After3.5 AfterFunc 4. Timer 的实现原理4.1 Timer数据结构4.1.1 Timer4.1.2 runtimeTimer 4.2 Timer 实现原理4.2.1 创建Timer…

golang学习笔记1-go程序执行流程

声明&#xff1a;本人已有C&#xff0c;C,Python基础&#xff0c;只写本人认为的重点&#xff0c;方便自己回顾。 命令行执行go程序有两种方式&#xff0c;其流程如下图 注意第一种方式会得到可执行文件&#xff0c;第二种不会。 例1 在当前目录下编译hello.go go build hel…