Beliebte Suchanfragen

Cloud Native

DevOps

IT-Security

Agile Methoden

Java

//

Measure your radosgw usage with OpenStack-Ansible

25.7.2018 | 2 minutes of reading time

We use OpenStack-Ansible to set up our OpenStack cluster and Ceph’s Rados Gateway (radosgw) as object store backend. Unfortunately, the telemetry (and in consequence accounting) for radosgw will not work out of the box. You need to change different parts of your OpenStack and Ceph setup to get it up and running. This blog post will explain what to change and where to change it.

Ceilometer needs additional pip packages to talk to Ceph Rados Gateway. To install it, edit the default ceilometer_pip_packages in your user_variables.yml file:

1ceilometer_pip_packages:
2- ceilometer
3- ceilometermiddleware
4- cryptography
5- gnocchiclient
6- libvirt-python
7- PyMySQL
8- pymongo
9- python-ceilometerclient
10- python-memcached
11- tooz
12- warlock
13- requests-aws>=0.1.4 #https://github.com/openstack/ceilometer/blob/stable/pike/test-requirements.txt

You also have to configure Ceilometer to actually query radosgw. When your ceilometer isn’t configured to poll everything, add these pollsters to your polling.yml file:

1- name: radosgw_pollsters
2    interval: 1200
3    meters:
4    -  rgw.containers.objects
5    -  rgw.containers.objects.size
6    -  rgw.objects
7    -  rgw.objects.size
8    -  rgw.objects.containers
9    -  rgw.usage

Be aware, these names changed with the Queens release. Add them also to your pipeline:

1- name: radosgw_source
2    interval: 60
3    meters:
4        - "rgw.objects"
5        - "rgw.objects.size"
6        - "rgw.objects.containers"
7        - "rgw.api.request"
8        - "rgw.containers.objects"
9        - "rgw.containers.objects.size"
10    sinks:
11        - meter_sink

Declare Ceph Rados Gateway as object-store in your ceilometer.conf file:

1[service_types]
2radosgw = object-store
3 
4[rgw_admin_credentials]
5access_key = XXX
6secret_key = XXX

This can be done with OpenStack-Ansible’s user_variables.yml file:

1ceilometer_ceilometer_conf_overrides:
2 service_types:
3   radosgw: object-store
4rgw_admin_credentials:
5   access_key: XXX
6   secret_key: XXX

The required credentials are created with these commands:

1radosgw-admin user create --uid admin --display-name "admin user" --caps "usage=read,write;metadata=read,write;users=read,write;buckets=read,write"

To get your credentials, execute:

1radosgw-admin user info --uid admin | jq '.keys'

That was all for the Ceilometer part, but you also need to change some configs for radosgw. The required changes are described in the documentation of Ceilometer.

These are the additions to your ceph.conf file on your radosgw servers:

1[client.radosgw.gateway]
2   rgw enable usage log = true
3   rgw usage log tick interval = 30
4   rgw usage log flush threshold = 1024
5   rgw usage max shards = 32
6   rgw usage max user shards = 1

After some polling, you should see radosgw metrics coming in:

1# openstack metric measures show --resource-id XXX radosgw.objects.size
2+---------------------------+-------------+-------+
3| timestamp                 | granularity | value |
4+---------------------------+-------------+-------+
5| 2018-06-07T12:00:00+00:00 |       300.0 |   1.0 |
6| 2018-06-07T12:05:00+00:00 |       300.0 |   1.0 |
7| 2018-06-07T12:10:00+00:00 |       300.0 |   1.0 |
8...

I hope this helped set up your ceilometer accounting for radosgw.

share post

Likes

0

//

More articles in this subject area

Discover exciting further topics and let the codecentric world inspire you.

//

Gemeinsam bessere Projekte umsetzen.

Wir helfen deinem Unternehmen.

Du stehst vor einer großen IT-Herausforderung? Wir sorgen für eine maßgeschneiderte Unterstützung. Informiere dich jetzt.

Hilf uns, noch besser zu werden.

Wir sind immer auf der Suche nach neuen Talenten. Auch für dich ist die passende Stelle dabei.