How to use mysql as backend in ceilometer installed by devstack?

asked 2013-07-15 12:58:54 -0600

guangyu gravatar image

Hi, all

I mean how to configurate devstack localrc to use mysql and how to generate mysql db tables ? I can rewrite the lib/ceilometer's connection to use mysql url, but it doesn't generate mysql db tables, which results ceilometer-api fails to start.

Can anyone help me ? Thanks!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-07-16 01:11:44 -0600

guangyu gravatar image

Currently, devstack doesn't support mysql as ceilometer backend, but for now, that is what I do :

1. enable ceilometer in localrc

enable_service ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api

2. change the database connection in lib/ceilometer

iniset $CEILOMETER_CONF database connection mysql://root:rachel@localhost/ceilometer?charset=utf8

where rachel is mysql password for root.

3. change ceilometer/collector/ code

    $ git diff
    diff --git a/ceilometer/collector/ b/ceilometer/collector/
    index 898e551..91b8c70 100644
    --- a/ceilometer/collector/
    +++ b/ceilometer/collector/
    @@ -112,6 +112,7 @@ class CollectorService(rpc_service.Service):
         def __init__(self, host, topic, manager=None):
             super(CollectorService, self).__init__(host, topic, manager)
             self.storage_conn = storage.get_connection(cfg.CONF)
    +        self.storage_conn.upgrade()

         def start(self):
             super(CollectorService, self).start()

then run ./, it will generate mysql db tables during ceilometer-collector starts.

edit flag offensive delete link more


But now, devstack has support mysql as ceilometer backend, just set CEILOMETER_BACKEND=mysql in localrc

guangyu gravatar imageguangyu ( 2013-07-25 21:05:10 -0600 )edit

Hi Rain Guan, I tried with CEILOMETER_BACKEND=mysql option in localrc. But I am still getting errors in ceilometer-api saying ceilometer-api failed to start.

shalmali gravatar imageshalmali ( 2014-01-02 04:01:52 -0600 )edit

answered 2015-01-16 00:24:21 -0600

exergy gravatar image

updated 2015-01-16 00:25:40 -0600

I was facing the same problem. For me it got resolved with change in FIXED_RANGE in local.conf and few changes in /etc/hosts file. Below is how my /etc/hosts looks like after changes localhost hadoop

#### hadoop hadoop

The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2013-07-15 12:58:54 -0600

Seen: 1,076 times

Last updated: Jan 16 '15