OpenStack stein安装(七)neutron on controller
admin
2023-03-13 03:41:11
0

  OpenStack网络(neutron)允许您创建并将其他OpenStack服务管理的接口设备附加到网络上。可以实现插件来适应不同的网络设备和软件,从而为OpenStack体系结构和部署提供灵活性。
  它包括以下组成部分:

  • neutron-server
    接受API请求并将其路由到适当的OpenStack网络插件以执行操作。
  • OpenStack Networking plug-ins and agents
    插件式的网络端口,创建网络或子网,并提供IP地址。这些插件和代理的差异取决于特定云中使用的供应商和技术。OpenStack网络附带了用于Cisco虚拟和物理交换机、NEC OpenFlow产品、Open vSwitch、Linux桥接和VMware NSX产品的插件和代理。
    常见的代理包括L3 (layer 3)、DHCP(动态主机IP寻址)和插件代理。
  • Messaging queue
    大多数OpenStack网络安装都使用它在neutron-server和各种代理之间路由信息。还充当数据库,存储特定插件的网络状态。

    Prerequisites

    Before you configure the OpenStack Networking (neutron) service, you must create a database, service credentials, and API endpoints.

    1. To create the database, complete these steps:
      ○ Use the database access client to connect to the database server as the root user:
      $ mysql -u root -p root123
      ○ Create the neutron database:
      MariaDB [keystone]> CREATE DATABASE neutron;
      ○ Grant proper access to the neutron database, replacing NEUTRON_DBPASS with a suitable password:
      MariaDB [keystone]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron123';
    2. Source the admin credentials to gain access to admin-only CLI commands:
      $ . admin-openrc
    3. To create the service credentials, complete these steps:

      ○ Create the neutron user:
      $ openstack user create --domain default --password-prompt neutron
      User Password:neutron123
      Repeat User Password:neutron123
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | default                          |
      | enabled             | True                             |
      | id                  | fdb0f541e28141719b6a43c8944bf1fb |
      | name                | neutron                          |
      | options             | {}                               |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
      ○ Add the admin role to the neutron user:
      $ openstack role add --project service --user neutron admin
       
      Note: This command provides no output.
      ○ Create the neutron service entity:
      $ openstack service create --name neutron --description "OpenStack Networking" network
      
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Networking             |
      | enabled     | True                             |
      | id          | f71529314dab4a4d8eca427e701d209e |
      | name        | neutron                          |
      | type        | network                          |
      +-------------+----------------------------------+
    4. Create the Networking service API endpoints:
      
      #openstack endpoint create --region RegionOne network public http://stack.flex.net:9696
      +--------------+----------------------------------+
      | Field        | Value                            |
      +--------------+----------------------------------+
      | enabled      | True                             |
      | id           | 85d80a6d02fc4b7683f611d7fc1493a3 |
      | interface    | public                           |
      | region       | RegionOne                        |
      | region_id    | RegionOne                        |
      | service_id   | f71529314dab4a4d8eca427e701d209e |
      | service_name | neutron                          |
      | service_type | network                          |
      | url          | http://stack.flex.net:9696           |
      +--------------+----------------------------------+

    #openstack endpoint create --region RegionOne network internal http://stack.flex.net:9696

    +--------------+----------------------------------+
    | Field | Value |
    +--------------+----------------------------------+
    | enabled | True |
    | id | 09753b537ac74422a68d2d791cf3714f |
    | interface | internal |
    | region | RegionOne |
    | region_id | RegionOne |
    | service_id | f71529314dab4a4d8eca427e701d209e |
    | service_name | neutron |
    | service_type | network |
    | url | http://stack.flex.net:9696 |
    +--------------+----------------------------------+

    #openstack endpoint create --region RegionOne network admin http://stack.flex.net:9696

    +--------------+----------------------------------+
    | Field | Value |
    +--------------+----------------------------------+
    | enabled | True |
    | id | 1ee14289c9374dffb5db92a5c112fc4e |
    | interface | admin |
    | region | RegionOne |
    | region_id | RegionOne |
    | service_id | f71529314dab4a4d8eca427e701d209e |
    | service_name | neutron |
    | service_type | network |
    | url | http://stack.flex.net:9696 |
    +--------------+----------------------------------+

    #### Configure networking options

    可以使用选项1和选项2表示的两种体系结构中的一种部署网络服务。

    选项1部署了最简单的体系结构,它只支持将实例附加到provider(external)网络。没有self-service(private)网络、路由器或浮动IP地址。只有管理员或其他特权用户才能管理provider网络。

    选项2支持将实例附加到自助服务网络的3层服务来增强选项1。demo或其他无特权用户可以管理自助服务网络,包括在自助服务网络和提供者网络之间提供连接的路由器。此外,浮动IP地址使用来自外部网络(如Internet)的自助服务网络提供到实例的连接。

    自服务网络通常使用overlay网络。overlay网络协议如vxlan包括额外的头部信息,这些头文件增加了开销,减少了有效负载或用户数据可用的空间。在不了解虚拟网络基础设施的情况下,实例尝试使用默认的1500字节以太网最大传输单元(MTU)发送数据包。网络服务通过DHCP自动向实例提供正确的MTU值。但是,有些云镜像不使用DHCP或忽略DHCP MTU选项,需要使用元数据或脚本进行配置。

    选择下列网络选项中的一个,或两个全选,参看下面的两个章节。并返回这里再向下继续配置
    ○ Networking Option 1: Provider networks
    ○ Networking Option 2: Self-service networks

Configure the metadata agent

The metadata agent provides configuration information such as credentials to instances.
Edit the /etc/neutron/metadata_agent.ini file and complete the following actions:

    ○ In the [DEFAULT] section, configure the metadata host and shared secret:
        [DEFAULT]
        # ...
        nova_metadata_host = stack.flex.net
        metadata_proxy_shared_secret = 1234 

        Replace METADATA_SECRET with a suitable secret for the metadata proxy.
Configure the Compute service to use the Networking service

Note: The Nova compute service must be installed to complete this step.
Edit the /etc/nova/nova.conf file and perform the following actions:

    ○ In the [neutron] section, configure access parameters, enable the metadata proxy, and configure the secret:
        [neutron]
        # ...
        url = http://stack.flex.net:9696
        auth_url = http://stack.flex.net:5000
        auth_type = password
        project_domain_name = default
        user_domain_name = default
        region_name = RegionOne
        project_name = service
        username = neutron
        password = neutron123
        service_metadata_proxy = true
        metadata_proxy_shared_secret = 1234
Finalize installation
  1. The Networking service initialization scripts expect a symbolic link /etc/neutron/plugin.ini pointing to the ML2 plug-in configuration file, /etc/neutron/plugins/ml2/ml2_conf.ini. If this symbolic link does not exist, create it using the following command:
    # ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
  2. Populate the database:
    # 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
    注意:由于脚本需要完整的服务器和插件配置文件,数据库填充将在稍后用于网络。 
  3. Restart the Compute API service:
    # systemctl restart openstack-nova-api.service
  4. Start the Networking services and configure them to start when the system boots.
For both networking options:
    # 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

For networking option 2, also enable and start the layer-3 service:
    # systemctl enable neutron-l3-agent.service
    # systemctl start neutron-l3-agent.service

相关内容

热门资讯

三预警齐发,台风“红霞”减弱为... 中央气象台7月26日10时继续发布台风黄色预警、暴雨红色预警和强对流天气黄色预警。台风黄色预警“红霞...
痛批民进党是台湾的敌人,侯汉廷... 海峡导报综合报道 国民党25日号召支持者上台北凯达格兰大道,举办“我是人、我反毒台”集会游行,主办方...
甘肃白银警方侦破一起16年前的... 澎湃新闻记者 吕鑫7月26日,甘肃省公安厅官方微信公众号文章披露,近日,白银市公安局平川分局命案攻坚...
音乐作品被白宫用于宣传打击伊朗... 据美国《国会山报》《华盛顿邮报》等多家媒体报道,美国流行歌手“水果姐”凯蒂·佩里当地时间25日在社交...
特朗普暂停空袭,美媒曝光核心原... 据《纽约时报》报道,在连续13晚对伊朗发动袭击后,7月25日,美军没有宣布任何夜间打击行动。据知情人...
一年内18次操纵证券市场,方某... 7月24日,根据中国证券监督管理委员会山东监管局发布的行政处罚决定书,方某军因一年内18次操纵市场的...
电热水器红色蓝色那里漏水 因为电热水器的发热器密封圈出现了破损,就会导致红色蓝色那里漏水;也有可能是由于电热水器的内胆出现了故...
电热水器漏水弹出一个圆片 可能是密封圈,是因为漏水造成这一部位出现问题,如果刚开始仅仅是滴水,慢慢的相邻的位置就开始出现侵蚀,...
电热水器为什么热水口不出水 因为温控器发生了故障,会导致电热水器的热水口不会出水;也有可能是因为对温控器所设置的水的温度太低;当...
电视不小心按成蓝屏了无信号 家里是机顶盒装置的电视,可以按遥控器上面的“信源”按键进行设置,一般选择正确的输入路径即可。如果家里...