Установка и настройка вычислительного узла

Установка и настройка вычислительного узла

This section describes how to install and configure the Compute service on a compute node. The service supports several hypervisors to deploy instances or VMs. For simplicity, this configuration uses the QEMU hypervisor with the KVM extension on compute nodes that support hardware acceleration for virtual machines. On legacy hardware, this configuration uses the generic QEMU hypervisor. You can follow these instructions with minor modifications to horizontally scale your environment with additional compute nodes.

Примечание

This section assumes that you are following the instructions in this guide step-by-step to configure the first compute node. If you want to configure additional compute nodes, prepare them in a similar fashion to the first compute node in the example architectures section. Each additional compute node requires a unique IP address.

Установите и сконфигурируйте компоненты

Примечание

Набор конфигурационных файлов по умолчанию может варьироваться между дистрибуциями. Вам может потребоваться добавить данные разделы и опции вместо того, чтобы изменять существующие. Также, эллипсис (...) в конфигурационных сниппетах означают потенциальные опции конфигурации, которые вам необходимо сохранить без изменений.

  1. Установите пакеты:

    # yum install openstack-nova-compute
    
  1. Отредактируйте файл /etc/nova/nova.conf и выполните следующие действия:

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

      [DEFAULT]
      # ...
      enabled_apis = osapi_compute,metadata
      
    • В разделе [DEFAULT] настройте доступ к RabbitMQ очереди сообщений:

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

      Замените RABBIT_PASS паролем, который вы выбрали для openstack аккаунта в RabbitMQ.

    • In the [api] and [keystone_authtoken] sections, configure Identity service access:

      [api]
      # ...
      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
      

      Замените NOVA_PASS `` паролем, который вы выбрали для пользователя ``nova в службе идентификации.

      Примечание

      Закомментируйте или удалите любые другие опции в разделе [keystone_authtoken].

    • В разделе “[DEFAULT]” задайте опцию “my_ip”:

      [DEFAULT]
      # ...
      my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS
      

      Замените MANAGEMENT_INTERFACE_IP_ADDRESS IP адресом управляющего сетевого интерфейса на вашем вычислительном узле, обычно это 10.0.0.31 для первого узла в архитектуре примера.

    • In the [DEFAULT] section, enable support for the Networking service:

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

      Примечание

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

    • In the [vnc] section, enable and configure remote console access:

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

      Серверный компонент слушает на всех IP-адресах, а прокси компонент слушает только на IP-адресе управляющего интерфейса вычислительного узла. Базовый URL указывает адрес, на который вы можете зайти с помощью веб браузера, чтобы получить доступ до удалённых консолей инстансов на вычислительном узле.

      Примечание

      If the web browser to access remote consoles resides on a host that cannot resolve the controller hostname, you must replace controller with the management interface IP address of the controller node.

    • В разделе [glance] настройте расположение для API сервиса управления образами:

      [glance]
      # ...
      api_servers = http://controller:9292
      
    • Настройте путь до файлов локов в разделе [oslo_concurrency]:

      [oslo_concurrency]
      # ...
      lock_path = /var/lib/nova/tmp
      
    • In the [placement] section, configure the Placement API:

      [placement]
      # ...
      os_region_name = RegionOne
      project_domain_name = Default
      project_name = service
      auth_type = password
      user_domain_name = Default
      auth_url = http://controller:35357/v3
      username = placement
      password = PLACEMENT_PASS
      

      Replace PLACEMENT_PASS with the password you choose for the placement user in the Identity service. Comment out any other options in the [placement] section.

Завершите установку

  1. Определите, поддерживает ли ваш вычислительный узел аппаратное ускорение для виртуальных машин:

    $ egrep -c '(vmx|svm)' /proc/cpuinfo
    

    Если эта команда возвращает значение один или больше, ваш вычислительный узел поддерживает аппаратное ускорение, для которого обычно дополнительная настройка не требуется.

    Если эта команда возвращает значение ноль, ваш вычислительный узел не поддерживает аппаратное ускорение, и вы должны настроить libvirt на использование QEMU вместо KVM.

    • Отредактируйте [libvirt] раздел в файле /etc/nova/nova.conf следующим образом:

      [libvirt]
      # ...
      virt_type = qemu
      
  1. Запустите сервис службы Вычислений, включая его зависимости, и настройте их автоматический запуск при загрузке системы:

    # systemctl enable libvirtd.service openstack-nova-compute.service
    # systemctl start libvirtd.service openstack-nova-compute.service
    

Примечание

If the nova-compute service fails to start, check /var/log/nova/nova-compute.log. The error message AMQP server on controller:5672 is unreachable likely indicates that the firewall on the controller node is preventing access to port 5672. Configure the firewall to open port 5672 on the controller node and restart nova-compute service on the compute node.

Add the compute node to the cell database

Важно

Run the following commands on the controller node.

  1. Source the admin credentials to enable admin-only CLI commands, then confirm there are compute hosts in the database:

    $ . admin-openrc
    
    $ openstack hypervisor list
    +----+---------------------+-----------------+-----------+-------+
    | ID | Hypervisor Hostname | Hypervisor Type | Host IP   | State |
    +----+---------------------+-----------------+-----------+-------+
    |  1 | compute1            | QEMU            | 10.0.0.31 | up    |
    +----+---------------------+-----------------+-----------+-------+
    
  2. Discover compute hosts:

    # su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
    
    Found 2 cell mappings.
    Skipping cell0 since it does not contain hosts.
    Getting compute nodes from cell 'cell1': ad5a5985-a719-4567-98d8-8d148aaae4bc
    Found 1 computes in cell: ad5a5985-a719-4567-98d8-8d148aaae4bc
    Checking host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3
    Creating host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3
    

    Примечание

    When you add new compute nodes, you must run nova-manage cell_v2 discover_hosts on the controller node to register those new compute nodes. Alternatively, you can set an appropriate interval in /etc/nova/nova.conf:

    [scheduler]
    discover_hosts_in_cells_interval = 300
    
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.