搭建多OpenStack多节点私有云平台(五)(网络服务)

(五)网络服务

Networking 网络服务

1、概述

​ OpenStack Networking(neutron),允许创建、插入接口设备,这些设备由其他的OpenStack服务管理。插件式的实现可以容纳不同的网络设备和软件,为OpenStack架构与部署提供了灵活性。

neutron-server

接收和路由API请求到合适的OpenStack网络插件,以达到预想的目的,端口9696

OpenStack网络插件和代理

neutron-linuxbridge-agent:创建桥接网卡,桥接到不同的网络上

neutron-dhcp-agent:负责分配IP地址

nutron-metadata-agent:配合nova-metadata-api实现虚拟机的定制化操作,例如:开机执行脚本

备注:上面是二层网络(数据链路层,平面网络flat就是常说的桥接,在同一个网段)

L3-agent:实现网络的高级功能,例如:三层网络vxlan(网络层)

LBaaS:Load balance 即服务(阿里云SLB)负载均衡服务

fwaaS:防火墙服务

vpnaaS………………

消息队列

大多数的OpenStack Networking安装都会用到,用于在neutron-server和各种各样的代理进程间路由信息。也为某些特定的插件扮演数据库的角色,以存储网络状态

OpenStack网络主要和OpenStack计算交互,以提供网络连接到它的实例。

2、安装配置(控制节点)

1、创建数据库并且授权

  • 用数据库连接客户端以 root 用户连接到数据库服务器:

    $ mysql -u root -p
    
  • 创建neutron 数据库:

    CREATE DATABASE neutron;
    
  • neutron 数据库授予合适的访问权限,使用合适的密码替换NEUTRON_DBPASS

    GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
      IDENTIFIED BY 'NEUTRON_DBPASS';
    GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
      IDENTIFIED BY 'NEUTRON_DBPASS';
    
  • 退出数据库客户端。

2、在keystone创建系统用户,并且关联角色

$ . admin-openrc
  • 创建neutron用户:

    $ openstack user create --domain default --password NEUTRON_PASS neutron
    +---------------------+----------------------------------+
    | Field               | Value                            |
    +---------------------+----------------------------------+
    | domain_id           | e4fa239b69d5422fae191fc03a18b6ec |
    | enabled             | True                             |
    | id                  | f93f25721f5044b9b27024bb9c93207c |
    | name                | neutron                          |
    | options             | {}                               |
    | password_expires_at | None                             |
    +---------------------+----------------------------------+
    
  • 添加admin 角色到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          | 970b04fb7c05450aa95d4b8cf0320f63 |
    | name        | neutron                          |
    | type        | network                          |
    +-------------+----------------------------------+
    

3、在keystone上创建服务和注册api

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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 5c996aeb4315431eba4313adcd1c4c56 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 970b04fb7c05450aa95d4b8cf0320f63 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+


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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | ca51621806aa46db88c2ea43132908f1 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 970b04fb7c05450aa95d4b8cf0320f63 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+


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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | ca51a2a1160b42faa842fd516ccc8c11 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 970b04fb7c05450aa95d4b8cf0320f63 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+

4、安装相应软件包

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

ebtables:作用和IPtable类似

5、修改相应服务的配置文件

  1. 公共网络(二层网络)

    配置服务组件

    编辑/etc/neutron/neutron.conf 文件并完成如下操作:

    • [database] 部分,配置数据库访问:

      [database]
      ...
      connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
      

      使用你设置的数据库密码替换 NEUTRON_DBPASS

    • [DEFAULT]部分,启用ML2插件并禁用其他插件:

      [DEFAULT]
      ...
      core_plugin = ml2
      service_plugins =
      
    • 在 “[DEFAULT]” 和 “[oslo_messaging_rabbit]”部分,配置 “RabbitMQ” 消息队列的连接:

      [DEFAULT]
      ...
      transport_url = rabbit://openstack:RABBIT_PASS@controller
      

      用你在RabbitMQ中为openstack选择的密码替换 “RABBIT_PASS”。

    • 在 “[DEFAULT]” 和 “[keystone_authtoken]” 部分,配置认证服务访问:

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

      NEUTRON_PASS 替换为你在认证服务中为 neutron 用户选择的密码。

    • [DEFAULT][nova]部分,配置网络服务来通知计算节点的网络拓扑变化:

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

      使用你在身份认证服务中设置的nova 用户的密码替换NOVA_PASS

    • [oslo_concurrency] 部分,配置锁路径:

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

    配置 Modular Layer 2 (ML2) 插件

    ML2插件使用Linuxbridge机制来为实例创建layer-2虚拟网络基础设施

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

    • [ml2]部分,启用flat和VLAN网络:

      [ml2]
      ...
      type_drivers = flat,vlan
      
    • [ml2]部分,禁用私有网络:

      [ml2]
      ...
      tenant_network_types =
      
    • [ml2]部分,启用Linuxbridge机制:

      [ml2]
      ...
      mechanism_drivers = linuxbridge
      

      linuxbridge:出现时间早,特别成熟,功能较少,稳定,配置简单

      openvswitch:出现时间晚,功能较多,稳定性不如linuxbridge,配置复杂

    • [ml2] 部分,启用端口安全扩展驱动:

      [ml2]
      ...
      extension_drivers = port_security
      
    • [ml2_type_flat]部分,配置公共虚拟网络为flat网络

      [ml2_type_flat]
      ...
      flat_networks = provider
      
    • [securitygroup]部分,启用 ipset增加安全组规则的高效性:

      [securitygroup]
      ...
      enable_ipset = True
      

    配置Linuxbridge代理

    Linuxbridge代理为实例建立layer-2虚拟网络并且处理安全组规则。

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

    • [linux_bridge]部分,将公共虚拟网络和公共物理网络接口对应起来:

      [linux_bridge]
      physical_interface_mappings = provider:ens33
      

      PUBLIC_INTERFACE_NAME 替换为底层的物理公共网络接口。

      PROVIDER_INTERFACE_NAME 换成物理网卡的名字,例如:ens33

      provider:PROVIDER_INTERFACE_NAME 物理网卡接口映射,和flat_networks = provider对应

    • [vxlan]部分,禁止VXLAN覆盖网络:

      [vxlan]
      enable_vxlan = False
      
    • [securitygroup]部分,启用安全组并配置 Linuxbridge iptables firewall driver:

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

      注释:

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

      编辑"/etc/sysctl.conf",添加下面2行

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

      要启用网络桥接支持,通常需要加载br_netfilter内核模块。

      [root@controller ~]# modprobe br_netfilter
      
      [root@controller ~]# sysctl -p
      net.bridge.bridge-nf-call-iptables = 1
      net.bridge.bridge-nf-call-ip6tables = 1
      

    配置DHCP代理

    编辑/etc/neutron/dhcp_agent.ini文件

    • [DEFAULT]部分,配置Linuxbridge驱动接口,DHCP驱动并启用隔离元数据,这样在公共网络上的实例就可以通过网络来访问元数据

      [DEFAULT]
      ...
      interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
      dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
      enable_isolated_metadata = True
      

    2.私有网络(三层网络,要先配二层网络)(暂时不配)

    配置服务组件

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

    • [database] 部分,配置数据库访问:

      [database]
      ...
      connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
      

      使用你设置的数据库密码替换 NEUTRON_DBPASS

    • [DEFAULT]部分,启用Modular Layer 2 (ML2)插件,路由服务和重叠的IP地址:

      [DEFAULT]
      ...
      core_plugin = ml2
      service_plugins = router
      allow_overlapping_ips = True
      
    • 在 “[DEFAULT]” 和 “[oslo_messaging_rabbit]”部分,配置 “RabbitMQ” 消息队列的连接:

      [DEFAULT]
      ...
      transport_url = rabbit://openstack:RABBIT_PASS@controller
      

      用你在RabbitMQ中为openstack选择的密码替换 “RABBIT_PASS”。

    • 在 “[DEFAULT]” 和 “[keystone_authtoken]” 部分,配置认证服务访问:

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

      NEUTRON_PASS 替换为你在认证服务中为 neutron 用户选择的密码。

    • [DEFAULT][nova]部分,配置网络服务来通知计算节点的网络拓扑变化:

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

      使用你在身份认证服务中设置的nova 用户的密码替换NOVA_PASS

    • [oslo_concurrency] 部分,配置锁路径:

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

    配置 Modular Layer 2 (ML2) 插件

    ML2插件使用Linuxbridge机制来为实例创建layer-2虚拟网络基础设施

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

    • [ml2]部分,启用flat,VLAN以及VXLAN网络:

      [ml2]
      ...
      type_drivers = flat,vlan,vxlan
      
    • [ml2]部分,启用VXLAN私有网络:

      [ml2]
      ...
      tenant_network_types = vxlan
      
    • [ml2]部分,启用Linuxbridge和layer-2机制:

      [ml2]
      ...
      mechanism_drivers = linuxbridge,l2population
      

    Linuxbridge代理只支持VXLAN覆盖网络。

    • [ml2] 部分,启用端口安全扩展驱动:

      [ml2]
      ...
      extension_drivers = port_security
      
    • [ml2_type_flat]部分,配置公共虚拟网络为flat网络

      [ml2_type_flat]
      ...
      flat_networks = provider
      
    • [ml2_type_vxlan]部分,为私有网络配置VXLAN网络识别的网络范围:

      [ml2_type_vxlan]
      ...
      vni_ranges = 1:1000
      
    • 在 [](https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/neutron-controller-install-option2.html#id1)[securitygroup]部分,启用 ipset 增加安全组规则的高效性:

      [securitygroup]
      ...
      enable_ipset = True
      

    配置Linuxbridge代理

    Linuxbridge代理为实例建立layer-2虚拟网络并且处理安全组规则

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

    • [linux_bridge]部分,将公共虚拟网络和公共物理网络接口对应起来:

      [linux_bridge]
      physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
      

      PUBLIC_INTERFACE_NAME 替换为底层的物理公共网络接口。

      PROVIDER_INTERFACE_NAME 换成物理网卡的名字,例如:ens33

    • [vxlan]部分,启用VXLAN覆盖网络,配置覆盖网络的物理网络接口的IP地址,启用layer-2 population:

      [vxlan]
      enable_vxlan = True
      local_ip = OVERLAY_INTERFACE_IP_ADDRESS
       l2_population = True
      

      OVERLAY_INTERFACE_IP_ADDRESS 替换为处理覆盖网络的底层物理网络接口的IP地址。这个示例架构中使用管理网络接口与其他节点建立流量隧道。因此,将OVERLAY_INTERFACE_IP_ADDRESS替换为控制节点的管理网络的IP地址。请查看:ref:environment-networking for more information。

    • [securitygroup]部分,启用安全组并配置 Linuxbridge iptables firewall driver:

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

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

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

      要启用网络桥接支持,通常需要加载br_netfilter内核模块。

    配置layer-3代理

    Layer-3代理为私有虚拟网络提供路由和NAT服务

    编辑/etc/neutron/l3_agent.ini文件

    [DEFAULT]部分,配置Linuxbridge接口驱动和外部网络网桥:

    [DEFAULT]
    ...
    interface_driver = linuxbridge
    

    配置DHCP代理

    编辑/etc/neutron/dhcp_agent.ini文件

    [DEFAULT]部分,配置Linuxbridge驱动接口,DHCP驱动并启用隔离元数据,这样在公共网络上的实例就可以通过网络来访问元数据

    [DEFAULT]
    ...
    interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
    dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
    enable_isolated_metadata = True
    

6、配置元数据代理

编辑/etc/neutron/metadata_agent.ini文件

[DEFAULT] 部分,配置元数据主机以及共享密码:

[DEFAULT]
...
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET

用你为元数据代理设置的密码替换 METADATA_SECRET

7、控制节点上的计算服务的网络服务配置

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

[neutron]部分,配置访问参数,启用元数据代理并设置密码:

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

service_metadata_proxy = True
metadata_proxy_shared_secret = METADATA_SECRET

NEUTRON_PASS 替换为你在认证服务中为 neutron 用户选择的密码。

使用你为元数据代理设置的密码替换METADATA_SECRET

6、同步数据库

  1. 网络服务初始化脚本需要一个超链接 /etc/neutron/plugin.ini 指向ML2插件配置文件/etc/neutron/plugins/ml2/ml2_conf.ini。如果超链接不存在,使用下面的命令创建它:

    # ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
    
  2. 同步数据库:

    # 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
    

    数据库的同步发生在 Networking 之后,因为脚本需要完成服务器和插件的配置文件。

  3. 重启计算API 服务:

    # systemctl restart openstack-nova-api.service
    
  4. 当系统启动时,启动 Networking 服务并配置它启动。

    对于两种网络选项:

    # 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
    

    弄完了公有网络查看弄好了没

    # neutron agent-list
    neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
    | id                                   | agent_type         | host       | availability_zone | alive | admin_state_up | binary                    |
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
    | 078d3cef-7efc-4b0d-8bf5-0949cb94f922 | Metadata agent     | controller |                   | :-)   | True           | neutron-metadata-agent    |
    | b5ce63c4-eb28-4556-8fa0-b34852026a82 | DHCP agent         | controller | nova              | :-)   | True           | neutron-dhcp-agent        |
    | b5d15026-3515-403a-9246-9dc6723f2029 | Linux bridge agent | controller |                   | :-)   | True           | neutron-linuxbridge-agent |
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
    

    对于网络选项2(私有网络),同样启用layer-3服务并设置其随系统自启动

    # systemctl enable neutron-l3-agent.service
    # systemctl start neutron-l3-agent.service
    

3、安装和配置(计算节点)

1、安装软件包

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

2、配置通用主键

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

  • [database] 部分,注释所有connection 项,因为计算节点不直接访问数据库。

  • 在 “[DEFAULT]” 和 “[oslo_messaging_rabbit]”部分,配置 “RabbitMQ” 消息队列的连接:

    [DEFAULT]
    ...
    transport_url = rabbit://openstack:RABBIT_PASS@controller
    

    用你在RabbitMQ中为openstack选择的密码替换 “RABBIT_PASS”。

  • 在 “[DEFAULT]” 和 “[keystone_authtoken]” 部分,配置认证服务访问:

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

    NEUTRON_PASS 替换为你在认证服务中为 neutron 用户选择的密码。

3、配置网络选项

  1. 公共网络

    配置Linuxbridge代理

    Linuxbridge代理为实例建立layer-2虚拟网络并且处理安全组规则

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

    • [linux_bridge]部分,将公共虚拟网络和公共物理网络接口对应起来:

      [linux_bridge]
      physical_interface_mappings = provider:ens33
      

      PUBLIC_INTERFACE_NAME 替换为底层的物理公共网络接口。请查看:[root@controller ~]# ip addr

    • [vxlan]部分,禁止VXLAN覆盖网络:

      [vxlan]
      enable_vxlan = False
      
    • [securitygroup]部分,启用安全组并配置 Linuxbridge iptables firewall driver:

      [securitygroup]
      ...
      enable_security_group = True
      firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
      
      • 确保您的Linux操作系统内核支持网桥过滤器,通过验证所有以下sysctl值设置为1:

        编辑"/etc/sysctl.conf",添加下面2行

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

        要启用网络桥接支持,通常需要加载br_netfilter内核模块。

        [root@controller ~]# modprobe br_netfilter
        
        [root@controller ~]# sysctl -p
        net.bridge.bridge-nf-call-iptables = 1
        net.bridge.bridge-nf-call-ip6tables = 1
        
  2. 私有网络(暂时不配)

    配置Linuxbridge代理

    Linuxbridge代理为实例建立layer-2虚拟网络并且处理安全组规则。

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

    • [linux_bridge]部分,将公共虚拟网络和公共物理网络接口对应起来:

      [linux_bridge]
      physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
      

      PUBLIC_INTERFACE_NAME 替换为底层的物理公共网络接口。PROVIDER_INTERFACE_NAME 换成物理网卡的名字,例如:ens33

    • [vxlan]部分,启用VXLAN覆盖网络,配置覆盖网络的物理网络接口的IP地址,启用layer-2 population:

      [vxlan]
      enable_vxlan = True
      local_ip = OVERLAY_INTERFACE_IP_ADDRESS
      l2_population = True
      

      OVERLAY_INTERFACE_IP_ADDRESS 替换为处理覆盖网络的底层物理网络接口的IP地址。这个示例架构中使用管理网络接口与其他节点建立流量隧道。因此,将OVERLAY_INTERFACE_IP_ADDRESS替换为控制节点的管理网络的IP地址。请查看:ref:environment-networking for more information。

    • 在 [](https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/neutron-compute-install-option2.html#id1)[securitygroup]部分,启用安全组并配置 Linuxbridge iptables firewall driver:

      [securitygroup]
      ...
      enable_security_group = True
      firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
      
      • (第2次重打没在计算节点打这个)确保您的Linux操作系统内核支持网桥过滤器,通过验证所有以下sysctl值设置为1:

        编辑"/etc/sysctl.conf",添加下面2行

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

        要启用网络桥接支持,通常需要加载br_netfilter内核模块。

        [root@controller ~]# modprobe br_netfilter
        
        [root@controller ~]# sysctl -p
        net.bridge.bridge-nf-call-iptables = 1
        net.bridge.bridge-nf-call-ip6tables = 1
        

4、为计算节点的计算服务配置网络服务

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

  • [neutron] 部分,配置访问参数:
[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 = NEUTRON_PASS

NEUTRON_PASS 替换为你在认证服务中为 neutron 用户选择的密码。

5、重启服务

  1. 重启计算服务:

    # systemctl restart openstack-nova-compute.service
    
  2. 启动Linuxbridge代理并配置它开机自启动:

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

4、验证操作

控制节点执行命令

  1. 获得 admin 凭证来获取只有管理员能执行的命令的访问权限:

    $ . admin-openrc
    
  2. 列出加载的扩展来验证neutron-server进程是否正常启动:

    $ openstack extension list --network
    
  3. 公共网络

    列出代理以验证启动 neutron 代理是否成功:

    $ openstack network agent list
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    | ID                                   | Agent Type         | Host       | Availability Zone | Alive | State | Binary                    |
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    | 078d3cef-7efc-4b0d-8bf5-0949cb94f922 | Metadata agent     | controller | None              | :-)   | UP    | neutron-metadata-agent    |
    | 93194d8f-82b8-41de-bb57-5f3b7988ea85 | Linux bridge agent | compute1   | None              | :-)   | UP    | neutron-linuxbridge-agent |
    | b5ce63c4-eb28-4556-8fa0-b34852026a82 | DHCP agent         | controller | nova              | :-)   | UP    | neutron-dhcp-agent        |
    | b5d15026-3515-403a-9246-9dc6723f2029 | Linux bridge agent | controller | None              | :-)   | UP    | neutron-linuxbridge-agent |
    +--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
    

    输出结果应该包括控制节点上的三个代理和每个计算节点上的一个代理。

  4. 私有网络

    列出代理以验证启动 neutron 代理是否成功:

    $  openstack network agent list
    

    输出结果应该包括控制节点上的四个代理和每个计算节点上的一个代理。

posted @ 2020-11-09 09:39  龙吟九枭  阅读(679)  评论(0)    收藏  举报