Skip to content

OpenStack Ceilometer

Manu edited this page Nov 9, 2016 · 3 revisions

Installation

OpenStack Ceilometer collector is written in Java 8 and requires connection to RabbitMQ. To install these dependencies please consult the installation page.

Relational database

Ceilometer collector also requires an access to a relational database. Even though you can deploy and use any backend database, the default database is PostgreSQL, which you can install and set up with

cd install
bash install_postgresql.sh
bash create_database.sh

Do not forget that if you are deploying PostgreSQL on a remote server, you will need to open default port 5432 and enable remote connections via editing the following files

Adding host all all 0.0.0.0/0 md5 to /etc/postgresql/9.3/main/postgresql.conf

Adding listen_addresses = '*' to /etc/postgresql/9.3/main/postgresql.conf

Configuration

For Ceilometer collector to function properly you will need to edit config/ceilometer.conf file and specify your Keystone credentials, as well as RabbitMQ and Hibernate connection settings, both of which can be accessed remotely. You can also specify on which port server should be listening or what date will be used for the first import.

Even though the config/ceilometer.conf file is commented, it is still important to pay attention to:

  • OpenstackAccount=openstackuser
  • OpenstackPassword=openstackpassword
  • KeystoneDomain=userDomain
  • KeystoneTenant=tenantWithCeilometerRights
  • CeilometerUrl=ceilometerUrl
  • KeystoneUrl=keystoneUrl
  • MetersUrl=ceilometerMetersEndpointUrl

By default the server port is 4573, but you can change it easily:

  • ServerHTTPPort=4573

If you are running RabbitMQ and Hibernate (PostgreSQL) on the same machine as Ceilometer collector, then you can leave other configuration parameter untouched, as they already point to the localhost.

Bindings

Before starting Ceilometer usage collection it is paramount to bind its exchanges to the RCB Cyclops queues. In order to do so simply run the following script and provide server's location and port RabbitMQ admin is listening on:

bash install/setup_bindings.sh localhost 15672

Logging

To have the logging system enabled you need to run the following:

bash install/setup_logging.sh

Then all Ceilometer collector logs will be stored in /var/log/cyclops/ceilometer/ directory.

Deployment

Once all prerequisites are installed and collector is configured you can start using it.

Run the JAR file

In order to run Ceilometer collector as embedded JAR:

java -jar bin/ceilometer.jar config/ceilometer.conf [port]

If you don't want to use the default port from configuration file, you can optionally specify one by adding it as parameter.

Compile from the source code

If you want to compile the code on your own and your environment already has Java 8 and Maven 3 present, simply execute the following commands:

cd scripts
bash compile.sh

You will find the compiled JAR embedded file in the bin subdirectory.

API guide

After the Ceilometer collector has started it will start collecting usage records from your OpenStack deployment. If anything goes wrong, please refer to logs (they have logical structure).

The Ceilometer collector operates based on internal scheduler, in order to periodically ask OpenStack for new usage records. These records are then processed, harmonised and broadcasted to RCB Cyclops (based on available bindings).

Even though everything happens automatically and you will receive new usage records every hour, you can still double check that internal scheduler is running, or even manually force a pull, all done by querying HTTP RESTful API interface:

Example scenario

If you want to know more about Rating-Charging-Billing for Ceilometer, as well as see what is happening behind the scenes, refer to this guide.

Clone this wiki locally