• 在ubuntu14.04上安装openstack mitaka


    最近在工作环境安装部署了juno版本,在GE口测试网络性能不太满意,发现mitaka版本支持ovs-dpdk,于是抽时间安装实验一番。

    参考官网的安装文档,先准备将mitaka版本安装好再配置ovs。

    实验环境:

    1、vmware 12

    2、controller节点:2vcpus,1G ram,20G disk,2 网卡

         compute1节点:4vcpus,2G ram,20G disk,2 网卡

    简便快速方式:在vm安装一个ubuntu14.04的server版本的虚拟机,配置好ssh,然后克隆出控制节点和计算节点。

     网络布局:

    存储节点暂时不安装,等需要研究需要再安装。

    管理网络:

    controller eth1配置10.0.0.11,compute1  eth1 配置10.0.0.21

    提供外部网络的网卡配置,都如下:

    在/etc/network/interfaces下添加
    auto eth2
    iface eth2 inet manual
    up ip link set dev $IFACE up
    down ip link set dev $IFACE down

    每个节点都执行如下操作:

    安装ntp:

    apt-get install chrony 

    更新源

    apt-get install software-properties-common

    add-apt-repository cloud-archive:mitaka

    apt-get update && apt-get dist-upgrade

    apt-get install python-openstackclient

    在控制节点:

    1.安装数据库

    apt-get install mariadb-server python-pymysql

    /etc/mysql/conf.d/openstack.cnf

    [mysqld]
    bind-address = 10.0.0.11
    default-storage-engine = innodb
    innodb_file_per_table
    max_connections = 4096
    collation-server = utf8_general_ci
    character-set-server = utf8

    service mysql restart

    mysql_secure_installation

    2.安装消息队列

    apt-get install rabbitmq-server
    rabbitmqctl add_user openstack 123456
    rabbitmqctl set_permissions openstack ".*" ".*" ".*"

    3.安装memcache

    apt-get install memcached python-memcache

    /etc/memcached.conf
    -l 10.0.0.11

    service memcached restart

    接下来安装keystone:

    控制节点:

    mysql -u root -p
    CREATE DATABASE keystone;
    GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'
      IDENTIFIED BY '123456';
     
    trait@controller:~$ openssl rand -hex 10
    4200b5b54aa051fd9234


    echo "manual" > /etc/init/keystone.override
    apt-get install keystone apache2 libapache2-mod-wsgi

    vim  /etc/keystone/keystone.conf

    [DEFAULT]
    admin_token = 4200b5b54aa051fd9234

    [database]
    connection = mysql+pymysql://keystone:123456@controller/keystone

    [token]
    provider = fernet

    su -s /bin/sh -c "keystone-manage db_sync" keystone

    keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone

    vim /etc/apache2/apache2.conf 添加如下内容:

    ServerName controller


    vim /etc/apache2/sites-available/wsgi-keystone.conf 添加如下内容:
    Listen 5000
    Listen 35357

    <VirtualHost *:5000>
        WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
        WSGIProcessGroup keystone-public
        WSGIScriptAlias / /usr/bin/keystone-wsgi-public
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        ErrorLogFormat "%{cu}t %M"
        ErrorLog /var/log/apache2/keystone.log
        CustomLog /var/log/apache2/keystone_access.log combined

        <Directory /usr/bin>
            Require all granted
        </Directory>
    </VirtualHost>

    <VirtualHost *:35357>
        WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
        WSGIProcessGroup keystone-admin
        WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        ErrorLogFormat "%{cu}t %M"
        ErrorLog /var/log/apache2/keystone.log
        CustomLog /var/log/apache2/keystone_access.log combined

        <Directory /usr/bin>
            Require all granted
        </Directory>
    </VirtualHost>

    ln -s /etc/apache2/sites-available/wsgi-keystone.conf /etc/apache2/sites-enabled
    service apache2 restart
    rm -f /var/lib/keystone/keystone.db

    创建服务:

    trait@controller:~$ export OS_TOKEN=4200b5b54aa051fd9234
    trait@controller:~$ export OS_URL=http://controller:35357/v3
    trait@controller:~$ export OS_IDENTITY_API_VERSION=3
    trait@controller:~$ openstack service create --name keystone --description "OpenStack Identity" identity
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | OpenStack Identity               |
    | enabled     | True                             |
    | id          | 370765e770414ccbafa044d67e6b2997 |
    | name        | keystone                         |
    | type        | identity                         |
    +-------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne identity public http://controller:5000/v3
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | b56b1648d5974882b7a2d06469a89d1c |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 370765e770414ccbafa044d67e6b2997 |
    | service_name | keystone                         |
    | service_type | identity                         |
    | url          | http://controller:5000/v3        |
    +--------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne identity admin http://controller:35357/v3
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 90e1e646f9114534bfee2049410065f7 |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 370765e770414ccbafa044d67e6b2997 |
    | service_name | keystone                         |
    | service_type | identity                         |
    | url          | http://controller:35357/v3       |
    +--------------+----------------------------------+

    创建域,项目,用户

    trait@controller:~$ openstack domain create --description "Default Domain" default
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Default Domain                   |
    | enabled     | True                             |
    | id          | ba70a48abe5941179904fee58d20ab66 |
    | name        | default                          |
    +-------------+----------------------------------+

    trait@controller:~$ openstack project create --domain default --description "Admin Project" admin
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Admin Project                    |
    | domain_id   | ba70a48abe5941179904fee58d20ab66 |
    | enabled     | True                             |
    | id          | 5648f07e1ded400caba4e0ff25f9e2a8 |
    | is_domain   | False                            |
    | name        | admin                            |
    | parent_id   | ba70a48abe5941179904fee58d20ab66 |
    +-------------+----------------------------------+
    trait@controller:~$ openstack user create --domain default --password-prompt admin
    User Password:
    Repeat User Password:
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | ba70a48abe5941179904fee58d20ab66 |
    | enabled   | True                             |
    | id        | 4b370d2454d5461b8cbe2fea56096b5a |
    | name      | admin                            |
    +-----------+----------------------------------+
    trait@controller:~$ openstack role create admin
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | None                             |
    | id        | 7e9491f8a9f2438fbc60f7f58ef6c100 |
    | name      | admin                            |
    +-----------+----------------------------------+
    trait@controller:~$ openstack role add --project admin --user admin admin
    trait@controller:~$

    trait@controller:~$ openstack project create --domain default --description "Service Project" service
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Service Project                  |
    | domain_id   | ba70a48abe5941179904fee58d20ab66 |
    | enabled     | True                             |
    | id          | 8042914fb1ee454db0d7701c408820cf |
    | is_domain   | False                            |
    | name        | service                          |
    | parent_id   | ba70a48abe5941179904fee58d20ab66 |
    +-------------+----------------------------------+
    trait@controller:~$ openstack project create --domain default --description "Demo Project" demo
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Demo Project                     |
    | domain_id   | ba70a48abe5941179904fee58d20ab66 |
    | enabled     | True                             |
    | id          | 1ac8bc179dd54ef8b7d8213174dee9aa |
    | is_domain   | False                            |
    | name        | demo                             |
    | parent_id   | ba70a48abe5941179904fee58d20ab66 |
    +-------------+----------------------------------+
    trait@controller:~$ openstack user create --domain default --password-prompt demo
    User Password:
    Repeat User Password:
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | ba70a48abe5941179904fee58d20ab66 |
    | enabled   | True                             |
    | id        | 23c004d3fe2942c4922d7c27dc71c7a8 |
    | name      | demo                             |
    +-----------+----------------------------------+

    trait@controller:~$ openstack role create user
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | None                             |
    | id        | c714aa17116b4e7985b15518f81127b9 |
    | name      | user                             |
    +-----------+----------------------------------+

    trait@controller:~$ openstack role add --project demo --user demo user
    trait@controller:~$

    OK 到这里keystone安装完成,第一次安装的话,可以按照官网的验证方法验证一下。

    创建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=123456
    export OS_AUTH_URL=http://controller:35357/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2


    export OS_PROJECT_DOMAIN_NAME=default
    export OS_USER_DOMAIN_NAME=default
    export OS_PROJECT_NAME=demo
    export OS_USERNAME=demo
    export OS_PASSWORD=123456
    export OS_AUTH_URL=http://controller:5000/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2
     

    创建demo-openrc脚本:

    接下来,开始安装glance:

    mysql -u root -p
    CREATE DATABASE glance;

    GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%'
      IDENTIFIED BY '123456';

    trait@controller:~$ . admin-openrc
    trait@controller:~$ openstack user create --domain default --password-prompt glance
    User Password:
    Repeat User Password:
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | ba70a48abe5941179904fee58d20ab66 |
    | enabled   | True                             |
    | id        | e635a5acc68a4a0e966ecdb6509b07a9 |
    | name      | glance                           |
    +-----------+----------------------------------+

    trait@controller:~$ openstack role add --project service --user glance admin
    trait@controller:~$ openstack service create --name glance --description "OpenStack Image" image
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | OpenStack Image                  |
    | enabled     | True                             |
    | id          | 29dc2fd78f5b41d79ef7738f9e5530c1 |
    | name        | glance                           |
    | type        | image                            |
    +-------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne image public http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 3d07b7ee32b543868c049ecf6ff5b82b |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 29dc2fd78f5b41d79ef7738f9e5530c1 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne image internal http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 98ee7d04e288469d80762f6e2860920e |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 29dc2fd78f5b41d79ef7738f9e5530c1 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne image admin http://controller:9292
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 33d3f1bc8cad44b69c846026e2ed0fdb |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 29dc2fd78f5b41d79ef7738f9e5530c1 |
    | service_name | glance                           |
    | service_type | image                            |
    | url          | http://controller:9292           |
    +--------------+----------------------------------+

    apt-get install glance

    在/etc/glance/glance-api.conf下添加,keystone_authtoken里只使用如下的内容。
    [database]
    connection = mysql+pymysql://glance:123456@controller/glance

    [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 = glance
    password = 123456

    [paste_deploy]
    flavor = keystone

    [glance_store]
    stores = file,http
    default_store = file
    filesystem_store_datadir = /var/lib/glance/images/

    在/etc/glance/glance-registry.conf添加如下内容:
    [database]
    connection = mysql+pymysql://glance:123456@controller/glance

    [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 = glance
    password = 123456

    [paste_deploy]
    flavor = keystone

    OK 可以 grep -v "^#" /etc/glance/glance-api.conf | grep -v "^$"   和 grep -v "^#" /etc/glance/glance-registry.conf | grep -v "^$" 检查一下是否正确。

    su -s /bin/sh -c "glance-manage db_sync" glance

    service glance-registry restart
    service glance-api restart

    glance 安装完成,可以上传cirros-0.3.4-x86_64-disk.img也可以自己制作镜像,后面我会再写一篇博客介绍一种比较方便的制作openstack镜像的方法。

     开始安装nova:控制节点:

    mysql -u root -p

    CREATE DATABASE nova_api;
    CREATE DATABASE nova;

    GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%'
      IDENTIFIED BY '123456';

    trait@controller:~$ . admin-openrc
    trait@controller:~$ openstack user create --domain default --password-prompt nova
    User Password:
    Repeat User Password:
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | ba70a48abe5941179904fee58d20ab66 |
    | enabled   | True                             |
    | id        | 8b35eaf6aa47472f84f2001ed132f668 |
    | name      | nova                             |
    +-----------+----------------------------------+

    trait@controller:~$ openstack role add --project service --user nova admin
    trait@controller:~$

    trait@controller:~$ openstack service create --name nova --description "OpenStack Compute" compute
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | OpenStack Compute                |
    | enabled     | True                             |
    | id          | 633998d68bb3418095453d7b3d337764 |
    | name        | nova                             |
    | type        | compute                          |
    +-------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%(tenant_id)s
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | a26320f613c847d88efac47b1306a786          |
    | interface    | public                                    |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 633998d68bb3418095453d7b3d337764          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%(tenant_id)s
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | 73a3f4a2b2e2442cb368d54c381988d1          |
    | interface    | internal                                  |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 633998d68bb3418095453d7b3d337764          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%(tenant_id)s
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | bffb5359cc324325a77a94f5b4576071          |
    | interface    | admin                                     |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 633998d68bb3418095453d7b3d337764          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+

    apt-get install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler

    在 /etc/nova/nova.conf 添加如下内容:

    [api_database]
    connection = mysql+pymysql://nova:123456@controller/nova_api

    [database]
    connection = mysql+pymysql://nova:123456@controller/nova

    [DEFAULT]
    enabled_apis = osapi_compute,metadata
    rpc_backend = rabbit
    my_ip = 10.0.0.11
    use_neutron = True
    firewall_driver = nova.virt.firewall.NoopFirewallDriver
    auth_strategy = keystone

    [vnc]
    vncserver_listen = $my_ip
    vncserver_proxyclient_address = $my_ip

    [glance]
    api_servers = http://controller:9292

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

    [oslo_messaging_rabbit]
    rabbit_host = controller
    rabbit_userid = openstack
    rabbit_password = 123456

    [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 = nova
    password = 123456

    在计算节点:

    apt-get install nova-compute

    在/etc/nova/nova.conf

    [DEFAULT]
    rpc_backend = rabbit
    auth_strategy = keystone
    my_ip = 10.0.0.21
    use_neutron = True
    firewall_driver = nova.virt.firewall.NoopFirewallDriver

    [oslo_messaging_rabbit]
    rabbit_host = controller
    rabbit_userid = openstack
    rabbit_password = 123456

    [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 = nova
    password = 123456

    [vnc]
    enabled = True
    vncserver_listen = 0.0.0.0
    vncserver_proxyclient_address = $my_ip
    novncproxy_base_url = http://controller:6080/vnc_auto.html

    [glance]
    api_servers = http://controller:9292

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

    root@compute1:~#  egrep -c '(vmx|svm)' /proc/cpuinfo
    4
    root@compute1:~#

    如上的话就不用修改nova-compute.conf了。如果你的返回是0,那么如下修改:

    [libvirt] 

    virt_type = qemu

    OK,下面开始安装neutron:

    在控制节点:

     mysql -u root -p
    CREATE DATABASE neutron;
    GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost'
      IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%'
      IDENTIFIED BY '123456';

    trait@controller:~$ . admin-openrc
    trait@controller:~$ openstack user create --domain default --password-prompt neutron
    User Password:
    Repeat User Password:
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | ba70a48abe5941179904fee58d20ab66 |
    | enabled   | True                             |
    | id        | fceb7cf67b984803819f01b88e99c42d |
    | name      | neutron                          |
    +-----------+----------------------------------+

    trait@controller:~$ openstack role add --project service --user neutron admin
    trait@controller:~$

    trait@controller:~$ openstack service create --name neutron --description "OpenStack Networking" network
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | OpenStack Networking             |
    | enabled     | True                             |
    | id          | 361a7983524c4ff6be00765bf2bbd03b |
    | name        | neutron                          |
    | type        | network                          |
    +-------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne network public http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 1bf3dc5f15ba4bb79fbbc5c478a9f7aa |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 361a7983524c4ff6be00765bf2bbd03b |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne  network internal http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 52341779fb3344b5bbcd6d6397a4a4af |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 361a7983524c4ff6be00765bf2bbd03b |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+

    trait@controller:~$ openstack endpoint create --region RegionOne  network admin http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | fabf84db1fdf4be0a774e0d1e36bc3c8 |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 361a7983524c4ff6be00765bf2bbd03b |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+

    安装L3代理的网络:

    apt-get install neutron-server neutron-plugin-ml2
      neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent
      neutron-metadata-agent

    在/etc/neutron/neutron.conf 添加:
    [database]
    connection = mysql+pymysql://neutron:123456@controller/neutron

    [DEFAULT]
    core_plugin = ml2
    service_plugins = router
    allow_overlapping_ips = True
    rpc_backend = rabbit
    notify_nova_on_port_status_changes = True
    notify_nova_on_port_data_changes = True

    auth_strategy = keystone

    [oslo_messaging_rabbit]
    rabbit_host = controller
    rabbit_userid = openstack
    rabbit_password = 123456

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

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

    /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

    /etc/neutron/plugins/ml2/linuxbridge_agent.ini
    [linux_bridge]
    physical_interface_mappings = provider:eth2

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

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

    /etc/neutron/l3_agent.ini
    [DEFAULT]
    interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
    external_network_bridge =

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

    /etc/neutron/metadata_agent.ini
    [DEFAULT]
    nova_metadata_ip = controller
    metadata_proxy_shared_secret = 123456

    /etc/nova/nova.conf
    [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 = 123456

    service_metadata_proxy = True
    metadata_proxy_shared_secret = 123456

    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

    service nova-api restart
    service neutron-server restart
    service neutron-linuxbridge-agent restart
    service neutron-dhcp-agent restart
    service neutron-metadata-agent restart
    service neutron-l3-agent restart

    在计算节点:

    apt-get install neutron-linuxbridge-agent

    /etc/neutron/neutron.conf

     在[database]这节 , 注释 connection 选项。because compute nodes do not directly access the database.

    [DEFAULT]
    rpc_backend = rabbit
    auth_strategy = keystone

    [oslo_messaging_rabbit]
    rabbit_host = controller
    rabbit_userid = openstack
    rabbit_password = 123456

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

    /etc/neutron/plugins/ml2/linuxbridge_agent.ini
    [linux_bridge]
    physical_interface_mappings = provider:eth2

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

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

    /etc/nova/nova.conf
    [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 = 123456

    service nova-compute restart
    service neutron-linuxbridge-agent restart

    trait@controller:~$ . admin-openrc
    trait@controller:~$ neutron ext-list
    +---------------------------+-----------------------------------------------+
    | alias                     | name                                          |
    +---------------------------+-----------------------------------------------+
    | default-subnetpools       | Default Subnetpools                           |
    | network-ip-availability   | Network IP Availability                       |
    | network_availability_zone | Network Availability Zone                     |
    | auto-allocated-topology   | Auto Allocated Topology Services              |
    | ext-gw-mode               | Neutron L3 Configurable external gateway mode |
    | binding                   | Port Binding                                  |
    | agent                     | agent                                         |
    | subnet_allocation         | Subnet Allocation                             |
    | l3_agent_scheduler        | L3 Agent Scheduler                            |
    | tag                       | Tag support                                   |
    | external-net              | Neutron external network                      |
    | net-mtu                   | Network MTU                                   |
    | availability_zone         | Availability Zone                             |
    | quotas                    | Quota management support                      |
    | l3-ha                     | HA Router extension                           |
    | provider                  | Provider Network                              |
    | multi-provider            | Multi Provider Network                        |
    | address-scope             | Address scope                                 |
    | extraroute                | Neutron Extra Route                           |
    | timestamp_core            | Time Stamp Fields addition for core resources |
    | router                    | Neutron L3 Router                             |
    | extra_dhcp_opt            | Neutron Extra DHCP opts                       |
    | security-group            | security-group                                |
    | dhcp_agent_scheduler      | DHCP Agent Scheduler                          |
    | router_availability_zone  | Router Availability Zone                      |
    | rbac-policies             | RBAC Policies                                 |
    | standard-attr-description | standard-attr-description                     |
    | port-security             | Port Security                                 |
    | allowed-address-pairs     | Allowed Address Pairs                         |
    | dvr                       | Distributed Virtual Router                    |
    +---------------------------+-----------------------------------------------+
    trait@controller:~$ neutron agent-list
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
    | id                                   | agent_type         | host       | availability_zone | alive | admin_state_up | binary                    |
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
    | 4e0b9ef6-f1af-40fa-8e12-71dbea095bc1 | L3 agent           | controller | nova              | :-)   | True           | neutron-l3-agent          |
    | 705d2004-8b9b-46e1-b583-53372cf4b857 | Linux bridge agent | controller |                   | :-)   | True           | neutron-linuxbridge-agent |
    | 75436579-b6c3-4a4d-a1f4-8bbf9e84e895 | Metadata agent     | controller |                   | :-)   | True           | neutron-metadata-agent    |
    | 9b2ac64b-3c8c-4499-a063-e0515360827b | Linux bridge agent | compute1   |                   | :-)   | True           | neutron-linuxbridge-agent |
    | ed38d626-c322-45bd-9c4e-7766d8654c35 | DHCP agent         | controller | nova              | :-)   | True           | neutron-dhcp-agent        |
    +--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+

    OK
    neutron安装完成。

  • 相关阅读:
    【ArcGIS 10.2新特性】ArcGIS 10.2将PostgreSQL原生数据发布为要素服务
    字节流,字符流 有什么区别
    java--模板方法模式
    hdu2829 四边形优化dp
    【ArcGIS 10.2新特性】ArcGIS 10.2 for Desktop 新特性(二)
    B/S架构 Web打印程序(Argox)
    poj 1611 The Suspects(并查集)
    microsoft visual studio遇到了问题,需要关闭
    [置顶] Windows显示驱动(WDDM)编程初步(2)
    Linux查看设置系统时区
  • 原文地址:https://www.cnblogs.com/danxi/p/6156177.html
Copyright © 2020-2023  润新知