Ubuntu 16.04
Sponsored Link

OpenStack Newton : Ceilometer 設定#22016/12/22

 
OpenStack Metering Service(Ceilometer)を設定します。
ここでは以下のような構築済みの環境に Ceilometer を追加インストールして設定します。
例として、Network Node に Metering サービス一式をインストールして設定します。
                                |
+------------------+            |            +------------------------+
| [ Control Node ] |            |            |    [ Network Node ]    |
|     Keystone     |10.0.0.30   |   10.0.0.50|    DHCP,L3,L2 Agent    |
|      Glance      |------------+------------|     Metadata Agent     |
|     Nova API     |eth0        |        eth0|   Ceilometer Services  |
|  Neutron Server  |            |            |                        |
+------------------+            |            +------------------------+
                            eth0|10.0.0.51
                      +--------------------+
                      |  [ Compute Node ]  |
                      |    Nova Compute    |
                      |      L2 Agent      |
                      | Ceilometer-Compute |
                      +--------------------+

 
ここでは Ceilometer のインストールと設定をします。
[1] Ceilometer はバックエンドDBに MongoDB を使用するため、インストールしておきます。
root@network:~#
apt-get -y install mongodb-server mongodb python-pymongo
[2] MongoDB を起動します。
root@network:~#
vi /etc/mongodb.conf
# 11行目:変更

bind_ip =
0.0.0.0
root@network:~#
systemctl restart mongodb
# Ceilometer 用 DB作成 (password の箇所は任意のパスワードを設定)

root@network:~#
mongo --host 10.0.0.50 --eval '
db = db.getSiblingDB("ceilometer");
db.createUser({user: "ceilometer",
pwd: "password",
roles: [ "readWrite", "dbAdmin" ]})'

MongoDB shell version: 2.6.10
connecting to: 10.0.0.50:27017/test
Successfully added user: { "user" : "ceilometer", "roles" : [ "readWrite", "dbAdmin" ] }
[3] Ceilometer をインストールします。
root@network:~#
apt-get -y install ceilometer-api ceilometer-collector ceilometer-agent-central ceilometer-agent-notification python-ceilometerclient python-ceilometerclient apache2 libapache2-mod-wsgi
[4] Ceilometer を設定します。
root@network:~#
mv /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf.org

root@network:~#
vi /etc/ceilometer/ceilometer.conf
# 新規作成

[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
[api]
port = 8777
host = 0.0.0.0
# MongoDB 接続情報

[database]
connection = mongodb://ceilometer:password@10.0.0.50:27017/ceilometer
# RabbitMQ 認証情報

[oslo_messaging_rabbit]
rabbit_host = 10.0.0.30
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = password
# Keystone への接続情報

[keystone_authtoken]
auth_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:35357
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = ceilometer
password = servicepassword
# Ceilometer 認証情報

[service_credentials]
os_auth_url = http://10.0.0.30:5000/v2.0
os_username = ceilometer
os_tenant_name = service
os_password = servicepassword
os_endpoint_type = internalURL
os_region_name = RegionOne
[5] httpd を設定します。
root@network:~#
vi /etc/apache2/sites-available/ceilometer.conf
Listen 8777

<VirtualHost *:8777>
    WSGIDaemonProcess ceilometer-api processes=2 threads=10 user=ceilometer group=ceilometer display-name=%{GROUP}
    WSGIProcessGroup ceilometer-api
    WSGIScriptAlias / "/var/www/cgi-bin/ceilometer/app"
    WSGIApplicationGroup %{GLOBAL}
    ErrorLog /var/log/apache2/ceilometer_error.log
    CustomLog /var/log/apache2/ceilometer_access.log combined
</VirtualHost>

WSGISocketPrefix /var/run/apache2

root@network:~#
mkdir -p /var/www/cgi-bin/ceilometer

root@network:~#
cp /usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi /var/www/cgi-bin/ceilometer/app

root@network:~#
a2ensite ceilometer

Enabling site ceilometer.
To activate the new configuration, you need to run:
service apache2 reload
root@network:~#
systemctl stop ceilometer-api

root@network:~#
systemctl disable ceilometer-api

root@network:~#
systemctl restart apache2
[6] Ceilometer を起動します。
root@network:~#
systemctl restart ceilometer-agent-central \
ceilometer-agent-notification \
ceilometer-collector

root@network:~#
systemctl enable ceilometer-agent-central \
ceilometer-agent-notification \
ceilometer-collector

関連コンテンツ