openstack-manuals/doc/install-guide/source/ceilometer-install.rst

14 KiB

Install and configure

This section describes how to install and configure the Telemetry service, code-named ceilometer, on the controller node. The Telemetry service collects measurements from most OpenStack services and optionally triggers alarms.

Prerequisites

Before you install and configure the Telemetry service, you must create a database, service credentials, and API endpoints. However, unlike other services, the Telemetry service uses a NoSQL database. See environment-nosql-database to install and configure MongoDB before proceeding further.

obs or ubuntu or debian

  1. Create the ceilometer database:

    # mongo --host controller --eval '
      db = db.getSiblingDB("ceilometer");
      db.createUser({user: "ceilometer",
      pwd: "CEILOMETER_DBPASS",
      roles: [ "readWrite", "dbAdmin" ]})'
    
    MongoDB shell version: 2.4.x
    connecting to: controller:27017/test
    {
     "user" : "ceilometer",
     "pwd" : "72f25aeee7ad4be52437d7cd3fc60f6f",
     "roles" : [
      "readWrite",
      "dbAdmin"
     ],
     "_id" : ObjectId("5489c22270d7fad1ba631dc3")
    }

    Replace CEILOMETER_DBPASS with a suitable password.

    Note

    If the command fails saying you are not authorized to insert a user, you may need to temporarily comment out the auth option in the /etc/mongodb.conf file, restart the MongoDB service using systemctl restart mongodb, and try calling the command again.

rdo

  1. Create the ceilometer database:

    # mongo --host controller --eval '
      db = db.getSiblingDB("ceilometer");
      db.createUser({user: "ceilometer",
      pwd: "CEILOMETER_DBPASS",
      roles: [ "readWrite", "dbAdmin" ]})'
    
    MongoDB shell version: 2.6.x
    connecting to: controller:27017/test
    Successfully added user: { "user" : "ceilometer", "roles" : [ "readWrite", "dbAdmin" ] }

    Replace CEILOMETER_DBPASS with a suitable password.

  1. Source the admin credentials to gain access to admin-only CLI commands:

    $ . admin-openrc
  2. To create the service credentials, complete these steps:

    • Create the ceilometer user:

      $ openstack user create --domain default --password-prompt ceilometer
      User Password:
      Repeat User Password:
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | e0353a670a9e496da891347c589539e9 |
      | enabled   | True                             |
      | id        | c859c96f57bd4989a8ea1a0b1d8ff7cd |
      | name      | ceilometer                       |
      +-----------+----------------------------------+
    • Add the admin role to the ceilometer user.

      $ openstack role add --project service --user ceilometer admin

      Note

      This command provides no output.

    • Create the ceilometer service entity:

      $ openstack service create --name ceilometer \
        --description "Telemetry" metering
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | Telemetry                        |
      | enabled     | True                             |
      | id          | 5fb7fd1bb2954fddb378d4031c28c0e4 |
      | name        | ceilometer                       |
      | type        | metering                         |
      +-------------+----------------------------------+
  3. Create the Telemetry service API endpoints:

    $ openstack endpoint create --region RegionOne \
      metering public http://controller:8777
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | b808b67b848d443e9eaaa5e5d796970c |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 5fb7fd1bb2954fddb378d4031c28c0e4 |
    | service_name | ceilometer                       |
    | service_type | metering                         |
    | url          | http://controller:8777           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      metering internal http://controller:8777
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | c7009b1c2ee54b71b771fa3d0ae4f948 |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 5fb7fd1bb2954fddb378d4031c28c0e4 |
    | service_name | ceilometer                       |
    | service_type | metering                         |
    | url          | http://controller:8777           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      metering admin http://controller:8777
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | b2c00566d0604551b5fe1540c699db3d |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 5fb7fd1bb2954fddb378d4031c28c0e4 |
    | service_name | ceilometer                       |
    | service_type | metering                         |
    | url          | http://controller:8777           |
    +--------------+----------------------------------+

Install and configure components

obs

  1. Install the packages:

    # zypper install openstack-ceilometer-api \
      openstack-ceilometer-collector \
      openstack-ceilometer-agent-notification \
      openstack-ceilometer-agent-central python-ceilometerclient

rdo

  1. Install the packages:

    # yum install openstack-ceilometer-api \
      openstack-ceilometer-collector openstack-ceilometer-notification \
      openstack-ceilometer-central python-ceilometerclient

ubuntu or debian

  1. Install the packages:

    # apt-get install ceilometer-api ceilometer-collector \
      ceilometer-agent-central ceilometer-agent-notification
      python-ceilometerclient

    debian

    Respond to prompts for debconf.

  1. Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:

    • In the [database] section, configure database access:

      [database]
      ...
      connection = mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer

      Replace CEILOMETER_DBPASS with the password you chose for the Telemetry service database. You must escape special characters such as ':', '/', '+', and '@' in the connection string in accordance with RFC2396.

    obs or rdo or ubuntu

    • In the [DEFAULT] and [oslo_messaging_rabbit] sections, configure RabbitMQ message queue access:

      [DEFAULT]
      ...
      rpc_backend = rabbit
      
      [oslo_messaging_rabbit]
      ...
      rabbit_host = controller
      rabbit_userid = openstack
      rabbit_password = RABBIT_PASS

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

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

      [DEFAULT]
      ...
      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 = ceilometer
      password = CEILOMETER_PASS

      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

    • In the [service_credentials] section, configure service credentials:

      [service_credentials]
      ...
      os_auth_url = http://controller:5000/v2.0
      os_username = ceilometer
      os_tenant_name = service
      os_password = CEILOMETER_PASS
      interface = internalURL
      region_name = RegionOne

      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

    obs

    • In the [collector] section, configure the dispatcher:

      [collector]
      ...
      dispatcher = database

obs or rdo or ubuntu

Configure the Apache HTTP server

rdo

  • Create the /etc/httpd/conf.d/wsgi-ceilometer.conf file with the following content:

    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/httpd/ceilometer_error.log
        CustomLog /var/log/httpd/ceilometer_access.log combined
    </VirtualHost>
    
    WSGISocketPrefix /var/run/httpd

ubuntu

  1. Create the /etc/apache2/sites-available/wsgi-ceilometer.conf file with the following content:

    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
  2. Enable the Telemetry service virtual hosts:

    # a2ensite ceilometer

obs

  • Create the /etc/apache2/conf.d/wsgi-ceilometer.conf file with the following content:

    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

Finalize installation

obs

  1. Reload the Apache HTTP server:

    # systemctl reload apache2.service
  2. Start the Telemetry services and configure them to start when the system boots:

    # systemctl enable openstack-ceilometer-agent-notification.service \
      openstack-ceilometer-agent-central.service \
      openstack-ceilometer-collector.service
    # systemctl start openstack-ceilometer-agent-notification.service \
      openstack-ceilometer-agent-central.service \
      openstack-ceilometer-collector.service

rdo

  1. Reload the Apache HTTP server:

    # systemctl reload httpd.service
  2. Start the Telemetry services and configure them to start when the system boots:

    # systemctl enable openstack-ceilometer-notification.service \
      openstack-ceilometer-central.service \
      openstack-ceilometer-collector.service
    # systemctl start openstack-ceilometer-notification.service \
      openstack-ceilometer-central.service \
      openstack-ceilometer-collector.service

ubuntu

  1. Reload the Apache HTTP server:

    # service apache2 reload
  2. Restart the Telemetry services:

    # service ceilometer-agent-central restart
    # service ceilometer-agent-notification restart
    # service ceilometer-collector restart