GNU/Linux >> LINUX-Kenntnisse >  >> Ubuntu

OpenStack Kilo auf Ubuntu 14.04.2 – Nova konfigurieren

Dieses Handbuch hilft Ihnen bei der Konfiguration des Nova (Compute)-Dienstes in einer OpenStak-Umgebung. In OpenStack wird der Compute-Dienst (Knoten) zum Hosten und Verwalten von Cloud-Computing-Systemen verwendet. OpenStack-Computing ist ein wichtiger Bestandteil von IaaS, es interagiert mit KeyStone für die Authentifizierung, den Image-Service für Festplatten und Images und das Dashboard für die Benutzer- und Verwaltungsschnittstelle.

OpenStack Compute kann auf Standardhardware horizontal skaliert werden und Bilder herunterladen, um eine Recheninstanz zu starten.

Installieren und konfigurieren Sie den Controller-Knoten:

Wir konfigurieren den Compute-Dienst auf dem Controller-Knoten und melden uns als Root-Benutzer beim MySQL-Server an.

# mysql -u root -p

Erstellen Sie die Nova-Datenbank.

CREATE DATABASE nova;

Erteilen Sie der nova-Datenbank eine ordnungsgemäße Berechtigung.

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'password';

Ersetzen Sie „Passwort“ durch ein passendes Passwort. Beenden Sie MySQL.

Laden Sie Ihre Admin-Anmeldeinformationen aus dem Umgebungsskript.

# source admin-openrc.sh

Erstellen Sie den nova-Benutzer zum Erstellen von Dienstanmeldeinformationen.

# openstack user create --password-prompt nova
User Password:
Repeat User Password:
+----------+----------------------------------+
| Field    | Value                            |
+----------+----------------------------------+
| email    | None                             |
| enabled  | True                             |
| id       | 58677ccc7412413587d138f686574867 |
| name     | nova                             |
| username | nova                             |
+----------+----------------------------------+

Fügen Sie dem nova-Benutzer die Administratorrolle hinzu.

# openstack role add --project service --user nova admin
+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | 33af4f957aa34cc79451c23bf014af6f |
| name  | admin                            |
+-------+----------------------------------+

Erstellen Sie die nova-Serviceentität.

# openstack service create --name nova --description "OpenStack Compute" compute

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 40bc66cafb164b18965528c0f4f5ab83 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

Erstellen Sie den nova-Service-API-Endpunkt.

# openstack endpoint create \
--publicurl http://controller:8774/v2/%\(tenant_id\)s \
--internalurl http://controller:8774/v2/%\(tenant_id\)s \
--adminurl http://controller:8774/v2/%\(tenant_id\)s \
--region RegionOne \
compute

+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| adminurl     | http://controller:8774/v2/%(tenant_id)s |
| id           | 3a61334885334ccaa822701ac1091080        |
| internalurl  | http://controller:8774/v2/%(tenant_id)s |
| publicurl    | http://controller:8774/v2/%(tenant_id)s |
| region       | RegionOne                               |
| service_id   | 40bc66cafb164b18965528c0f4f5ab83        |
| service_name | nova                                    |
| service_type | compute                                 |
+--------------+-----------------------------------------+

Compute-Controller-Komponenten installieren und konfigurieren:

Installieren Sie die Pakete auf dem Controller Node.

# apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient

Bearbeiten Sie die /etc/nova/nova.conf.

# nano /etc/nova/nova.conf

Ändern Sie die folgenden Einstellungen und stellen Sie sicher, dass Sie Einträge in den richtigen Abschnitten platzieren.

[DEFAULT]
...
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.12.21 
## Management IP of Controller Node
vncserver_listen = 192.168.12.21 
## Management IP of Controller Node
vncserver_proxyclient_address = 192.168.12.21 
## Management IP of Controller Node

[database]
connection = mysql://nova:password@controller/nova

## Replace "password" with the password you chose for nova database

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

## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

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

Füllen Sie die Compute-Datenbank.

#  su -s /bin/sh -c "nova-manage db sync" nova

Starten Sie die Rechendienste neu.

# service nova-api restart
# service nova-cert restart
# service nova-consoleauth restart
# service nova-scheduler restart
# service nova-conductor restart
# service nova-novncproxy restart

Entfernen Sie die SQLite-Datenbankdatei.

# rm -f /var/lib/nova/nova.sqlite

Installieren und konfigurieren Sie Nova (ein Rechenknoten):

Hier installieren und konfigurieren wir den Compute-Dienst auf einem Rechenknoten. Dieser Dienst unterstützt mehrere Hypervisoren zum Bereitstellen von Instanzen (VMs). Unser Rechenknoten verwendet den QEMU-Hypervisor mit KVM-Erweiterung zur Unterstützung der hardwarebeschleunigten Virtualisierung.

Überprüfen Sie, ob Ihr Computer Hardwarevirtualisierung unterstützt.

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

Wenn der Befehl den Wert 1 oder mehr zurückgibt, unterstützt Ihr Rechenknoten die Virtualisierung.

Stellen Sie sicher, dass Sie das OpenStack Kilo-Repository auf dem Rechenknoten aktiviert haben, oder befolgen Sie die nachstehenden Schritte, um es zu aktivieren.

Installieren Sie den Schlüsselbund und das Repository des Ubuntu Cloud-Archivs.

# apt-get install ubuntu-cloud-keyring

# echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu" "trusty-updates/kilo main" > /etc/apt/sources.list.d/cloudarchive-kilo.list

Aktualisieren Sie Ihr System.

# apt-get update

Installieren Sie die folgenden Pakete auf jedem einzelnen Rechenknoten.

# apt-get install nova-compute sysfsutils

Bearbeiten Sie /etc/nova/nova-compute.conf, um QEMU zu aktivieren.

# nano /etc/nova/nova-compute.conf/
Change virt_type=kvm to qemu in libvirt section.
[libvirt]
...
virt_type = qemu

Bearbeiten Sie die /etc/nova/nova.conf.

# nano /etc/nova/nova.conf

Ändern Sie die folgenden Einstellungen und stellen Sie sicher, dass Sie Einträge in den richtigen Abschnitten platzieren.

[DEFAULT]
...
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.12.23
## Management IP of Compute Node
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 192.168.12.23
## Management IP of Compute Node
novncproxy_base_url = http://controller:6080/vnc_auto.html

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password
## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

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

Starten Sie den Rechendienst neu.

# service nova-compute restart

Entfernen Sie die SQLite-Datenbankdatei.

# rm -f /var/lib/nova/nova.sqlite

Betrieb überprüfen:

Administratoranmeldeinformationen auf Controller-Knoten laden.

# source admin-openrc.sh

Listen Sie die zu überprüfenden Compute-Service-Komponenten auf und führen Sie den folgenden Befehl auf dem Controller-Knoten aus.

# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-cert        | controller | internal | enabled | up    | 2015-06-29T20:38:48.000000 | -               |
| 2  | nova-conductor   | controller | internal | enabled | up    | 2015-06-29T20:38:46.000000 | -               |
| 3  | nova-consoleauth | controller | internal | enabled | up    | 2015-06-29T20:38:41.000000 | -               |
| 4  | nova-scheduler   | controller | internal | enabled | up    | 2015-06-29T20:38:50.000000 | -               |
| 5  | nova-compute     | compute    | nova     | enabled | up    | 2015-06-29T20:38:49.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

Sie sollten eine Ausgabe mit vier aktivierten Dienstkomponenten auf dem Controller-Knoten und einer aktivierten Dienstkomponente auf dem Rechenknoten erhalten.

Bilder im Bilddienstkatalog auflisten, um die Konnektivität mit dem Bilddienst zu überprüfen.

# nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID                                   | Name                | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| b19c4522-df31-4331-a2e1-5992abcd4ded | Ubuntu_14.04-x86_64 | ACTIVE |        |
+--------------------------------------+---------------------+--------+--------+

Das ist alles !!!, Sie haben den Nova-Dienst erfolgreich konfiguriert. Als nächstes konfigurieren Sie OpenStack Networking (Neutron).


Ubuntu
  1. Installieren Sie OpenStack Kilo auf Ubuntu 14.04.2

  2. OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie Swift #1

  3. OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie Cinder #2

  4. OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie Cinder #1

  5. OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie Horizon

OpenStack Liberty auf Ubuntu 14.04 LTS – Nova konfigurieren

OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie Neutron #1

OpenStack Kilo auf Ubuntu 14.04.2 – Glance konfigurieren

OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie KeyStone #2

OpenStack Kilo auf Ubuntu 14.04.2 – Konfigurieren Sie KeyStone #1

OpenStack Liberty auf Ubuntu 14.04 – Konfigurieren Sie Neutron #2