Ubuntu 18.04
Sponsored Link

OpenStack Queens : Aodh 設定2018/06/20

 
OpenStack Alarming Service (Aodh) をインストールします。
当例では以下のような環境を例に Control ノードへ Aodh サービス一式をインストールします。
Ubuntu 18.04 の OpenStack Queens パッケージでは Python3 系の WSGI を使用する Gnocchi と Python2 系の WSGI を使用する Keystone や Nova, Aodh などのその他コンポーネントのパッケージと競合するため、同一ノードへインストール不可です。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Network Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Linux Bridge     |   |        Libvirt        |
|  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
|  Keystone   Glance    |   |        L3_Agent       |   |      Linux Bridge     |
|  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
|  Neutron_Server       |   |     Cinder_Volume     |   |   Ceilometer_Compute  |
|  Metadata_Agent       |   |        Heat_API       |   |                       |
|    Aodh_Evaluator     |   |      Heat Engine      |   |                       |
|                       |   |    Gnocchi  httpd     |   |                       |
|                       |   |   Ceilometer_Central  |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[1]
事前に Gnocchi および Ceilometer をインストールしておきます。
[2] Control ノードの Keystone に Aodh 用のユーザー等々を登録しておきます。
# aodh ユーザー作成 (service プロジェクト所属)

root@dlp ~(keystone)#
openstack user create --domain default --project service --password servicepassword aodh

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | fa8bf7aca73e44cb9bc2c9f42859857e |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 58230d6a1b4341d9932cda9e6cfad8fa |
| name                | aodh                             |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# aodh ユーザーを admin ロール に加える

root@dlp ~(keystone)#
openstack role add --project service --user aodh admin
# aodh 用サービスエントリ作成

root@dlp ~(keystone)#
openstack service create --name aodh --description "Telemetry Alarming" alarming

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Telemetry Alarming               |
| enabled     | True                             |
| id          | 992242c1027c426eaf3c5724de9d1ada |
| name        | aodh                             |
| type        | alarming                         |
+-------------+----------------------------------+

# aodh api ホストを定義しておく

root@dlp ~(keystone)#
export controller=10.0.0.30
# aodh 用エンドポイント作成 (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne alarming public http://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 6a80590a15294ee8b1ebf9285e7ac4d1 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 88c6a85a51584ac9bc7e34ff118916e8 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | http://10.0.0.30:8042            |
+--------------+----------------------------------+

# aodh 用エンドポイント作成 (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne alarming internal http://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 9b64209a4d0b42799b721d74c96f8fc6 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 88c6a85a51584ac9bc7e34ff118916e8 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | http://10.0.0.30:8042            |
+--------------+----------------------------------+

# aodh 用エンドポイント作成 (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne alarming admin http://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 41f11677ed854c83a78a15f8579a4a21 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 88c6a85a51584ac9bc7e34ff118916e8 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | http://10.0.0.30:8042            |
+--------------+----------------------------------+
[3] Aodh 用のユーザーとデータベースを MariaDB に登録しておきます。
root@dlp ~(keystone)#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 91
Server version: 10.1.29-MariaDB-6 Ubuntu 18.04

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database aodh;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on aodh.* to aodh@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on aodh.* to aodh@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
[4] Aodh サービスをインストールします。
root@dlp ~(keystone)#
apt -y install aodh-api aodh-evaluator aodh-notifier aodh-listener aodh-expirer python-aodhclient
[5] Aodh の基本設定です。
root@dlp ~(keystone)#
mv /etc/aodh/aodh.conf /etc/aodh/aodh.conf.org

root@dlp ~(keystone)#
vi /etc/aodh/aodh.conf
# 新規作成

[DEFAULT]
log_dir = /var/log/aodh
# RabbitMQ 接続情報
transport_url = rabbit://openstack:password@10.0.0.30

[api]
auth_mode = keystone
gnocchi_external_project_owner = service

[database]
# MariaDB 接続情報
connection = mysql+pymysql://aodh:password@10.0.0.30/aodh

# Keystone 認証情報
[keystone_authtoken]
www_authenticate_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:5000
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = aodh
password = servicepassword

[service_credentials]
auth_url = http://10.0.0.30:5000/v3
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = aodh
password = servicepassword
interface = internalURL

root@dlp ~(keystone)#
chmod 644 /etc/aodh/aodh.conf

root@dlp ~(keystone)#
chgrp aodh /etc/aodh/aodh.conf

root@dlp ~(keystone)#
su -s /bin/bash aodh -c "aodh-dbsync"

root@dlp ~(keystone)#
systemctl restart aodh-evaluator aodh-notifier aodh-listener

root@dlp ~(keystone)#
systemctl enable aodh-evaluator aodh-notifier aodh-listener

root@dlp ~(keystone)#
systemctl restart apache2

関連コンテンツ