OpenStack Rocky : Aodh 設定2018/09/06 |
OpenStack Alarming Service (Aodh) をインストールします。
当例では以下のような環境を例に Control ノードへ Aodh サービス一式をインストールします。
------------+---------------------------+---------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] | | | | | | | | MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | Memcached httpd | | L2 Agent | | Nova Compute | | Keystone Glance | | L3 Agent | | Open vSwitch | | Nova API Cinder API | | Metadata Agent | | L2 Agent | | Neutron Server | | Cinder Volume | | Ceilometer Compute | | Metadata Agent | | Heat API | | | | Gnocchi | | Heat Engine | | | | Ceilometer Central | | | | | | Aodh Evaluator | | | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[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 | ece4ac6c7e764a979e36ba0b2faf848e | | domain_id | default | | enabled | True | | id | ef3a4fd9be904e11987a03133b3121a0 | | 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 | 2ff8842b9f654c69b702097a4f6285f8 | | 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 | b26e6d94d0c34c2d8d9fbc7dd23153e4 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 2ff8842b9f654c69b702097a4f6285f8 | | 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 | 9f61b6053cb84495b1c7c8e69690e815 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 2ff8842b9f654c69b702097a4f6285f8 | | 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 | 65b8dd399efb4d068da9425e506ff294 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 2ff8842b9f654c69b702097a4f6285f8 | | 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 71 Server version: 10.1.20-MariaDB MariaDB Server Copyright (c) 2000, 2016, 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)]>
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) exit Bye |
[4] | Aodh サービスをインストールします。 |
[root@dlp ~(keystone)]# yum --enablerepo=centos-openstack-rocky,epel -y install openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python2-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)]#
vi /etc/httpd/conf.d/20-aodh_wsgi.conf # 新規作成 Listen 8042 <VirtualHost *:8042> <Directory /usr/bin> AllowOverride None Require all granted </Directory> CustomLog "/var/log/httpd/aodh_wsgi_access.log" combined ErrorLog "/var/log/httpd/aodh_wsgi_error.log" SetEnvIf X-Forwarded-Proto https HTTPS=1 WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess aodh display-name=aodh_wsgi user=aodh group=aodh processes=6 threads=3 WSGIProcessGroup aodh WSGIScriptAlias / /usr/bin/aodh-api </VirtualHost> chmod 640 /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 start openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener [root@dlp ~(keystone)]# systemctl enable openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener [root@dlp ~(keystone)]# systemctl restart httpd |
[6] | SELinux を有効にしている場合は、ポリシーの変更が必要です。 |
[root@dlp ~(keystone)]# semanage port -a -t http_port_t -p tcp 8042 |
[7] | Firewalld を有効にしている場合は、サービスポートの許可が必要です。 |
[root@dlp ~(keystone)]# firewall-cmd --add-port=8042/tcp --permanent success [root@dlp ~(keystone)]# firewall-cmd --reload success |
Sponsored Link |
|