Instalace a nastavení uzlu kontroléru

Instalace a nastavení uzlu kontroléru

This section describes how to install and configure the Compute service, code-named nova, on the controller node.

Požadavky

Before you install and configure the Compute service, you must create databases, service credentials, and API endpoints.

  1. To create the databases, complete these steps:

    • Použijte klienta pro přístup k databázi a přihlaste se na něj jako uživatel root:

      $ mysql -u root -p
      
    • Create the nova_api and nova databases:

      mysql> CREATE DATABASE nova_api;
      mysql> CREATE DATABASE nova;
      
    • Grant proper access to the databases:

      mysql> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      mysql> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
        IDENTIFIED BY 'NOVA_DBPASS';
      mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
        IDENTIFIED BY 'NOVA_DBPASS';
      

      Replace NOVA_DBPASS with a suitable password.

    • Ukončete klienta s přístup k databázi.

  2. Použijte příkaz source pro přihlašovací údaje pro admin pro získání přístupu k příkazům příkazového řádku pro správce:

    $ . admin-openrc
    
  3. Proveďte následující kroky pro vytvoření přihlašovacích údajů služby:

    • Create the nova user:

      $ openstack user create --domain default \
        --password-prompt nova
      
      User Password:
      Repeat User Password:
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | default                          |
      | enabled             | True                             |
      | id                  | 8a7dbf5279404537b1c7b86c033620fe |
      | name                | nova                             |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
      
    • Add the admin role to the nova user:

      $ openstack role add --project service --user nova admin
      

      Poznámka

      Tento příkaz nemá žádný výstup.

    • Create the nova service entity:

      $ openstack service create --name nova \
        --description "OpenStack Compute" compute
      
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Compute                |
      | enabled     | True                             |
      | id          | 060d59eac51b4594815603d75a00aba2 |
      | name        | nova                             |
      | type        | compute                          |
      +-------------+----------------------------------+
      
  4. Create the Compute service API endpoints:

    $ openstack endpoint create --region RegionOne \
      compute public http://controller:8774/v2.1/%\(tenant_id\)s
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | 3c1caa473bfe4390a11e7177894bcc7b          |
    | interface    | public                                    |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute internal http://controller:8774/v2.1/%\(tenant_id\)s
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | e3c918de680746a586eac1f2d9bc10ab          |
    | interface    | internal                                  |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute admin http://controller:8774/v2.1/%\(tenant_id\)s
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | 38f7af91666a47cfb97b4dc790b94424          |
    | interface    | admin                                     |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1/%(tenant_id)s |
    +--------------+-------------------------------------------+
    

Instalace a nastavení součástí

Poznámka

Default configuration files vary by distribution. You might need to add these sections and options rather than modifying existing sections and options. Also, an ellipsis (...) in the configuration snippets indicates potential default configuration options that you should retain.

  1. Nainstalujte balíčky:

    # zypper install openstack-nova-api openstack-nova-scheduler \
      openstack-nova-conductor openstack-nova-consoleauth \
      openstack-nova-novncproxy iptables
    
  1. Upravte soubor /etc/nova/nova.conf a proveďte následující úkony:

    • In the [DEFAULT] section, enable only the compute and metadata APIs:

      [DEFAULT]
      ...
      enabled_apis = osapi_compute,metadata
      
    • In the [api_database] and [database] sections, configure database access:

      [api_database]
      ...
      connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
      
      [database]
      ...
      connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
      

      Replace NOVA_DBPASS with the password you chose for the Compute databases.

    • In the [DEFAULT] section, configure RabbitMQ message queue access:

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

      Nahraďte RABBIT_PASS Vámi zvoleným heslem pro účet openstack v RabbitMQ.

    • V částech [DEFAULT] a [keystone_authtoken] nastavte přístup ke službě identit:

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

      Nahraďte NOVA_PASS vámi zvoleným heslem pro uživatele nova ve službě identit.

      Poznámka

      Okomentujte nebo odstraňte všechny ostatní možnosti v části [keystone_authtoken].

    • V části [DEFAULT] nastavte volbu my_ip pro zvolení IP adresy rozhraní pro správce v uzlu kontroléru:

      [DEFAULT]
      ...
      my_ip = 10.0.0.11
      
    • In the [DEFAULT] section, enable support for the Networking service:

      [DEFAULT]
      ...
      use_neutron = True
      firewall_driver = nova.virt.firewall.NoopFirewallDriver
      

      Poznámka

      By default, Compute uses an internal firewall driver. Since the Networking service includes a firewall driver, you must disable the Compute firewall driver by using the nova.virt.firewall.NoopFirewallDriver firewall driver.

    • In the [vnc] section, configure the VNC proxy to use the management interface IP address of the controller node:

      [vnc]
      ...
      vncserver_listen = $my_ip
      vncserver_proxyclient_address = $my_ip
      
    • In the [glance] section, configure the location of the Image service API:

      [glance]
      ...
      api_servers = http://controller:9292
      
    • V části [oslo_concurrencyservice_credentials] nastavte cestu pro zámky:

    [oslo_concurrency]
    ...
    lock_path = /var/run/nova
    

Dokončení instalace

  • Start the Compute services and configure them to start when the system boots:

    # systemctl enable openstack-nova-api.service \
      openstack-nova-consoleauth.service openstack-nova-scheduler.service \
      openstack-nova-conductor.service openstack-nova-novncproxy.service
    # systemctl start openstack-nova-api.service \
      openstack-nova-consoleauth.service openstack-nova-scheduler.service \
      openstack-nova-conductor.service openstack-nova-novncproxy.service
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.