一、ceilometer对接goncchi
使用rdo安装M版本的openstack环境后,当前默认采集的数据是保存在mongodb中的,此时需要将采样的数据对接到gnocchi中。
1、修改ceilometer的配置文件:
ceilometer.conf
[DEFAULT]
meter_dispatchers = gnocchi
[dispatcher_gnocchi]
filter_project = services
filter_service_activity = False
archive_policy = low
url = http://localhost:8041
2、创建gnocchi默认的存储规则,跟ceilometer配置文件中 archive_policy = low 保持一致即可
gnocchi archive-policy create -d granularity:0:00:01,points:3600,timespan:1:00:00 -d granularity:0:01:00,points:3600 -d granularity:01:00:00,points:3600 low
3、重启ceilometer
systemctl restart httpd
systemctl restart openstack-ceilometer-central.service
systemctl restart openstack-ceilometer-collector.service
systemctl restart openstack-ceilometer-compute.service
systemctl restart openstack-ceilometer-notification.service
systemctl restart openstack-ceilometer-polling.service
4、检验:
4.1 调用gnocchi resource list-types 可以看到当前gnocchi定义的资源信息
gnocchi resource list-types
+----------------------------+-----------------------------------------------------------------+
| resource_type | resource_controller_url |
+----------------------------+-----------------------------------------------------------------+
| ceph_account | http://192.168.6.48:8041/v1/resource/ceph_account |
| network | http://192.168.6.48:8041/v1/resource/network |
| instance | http://192.168.6.48:8041/v1/resource/instance |
| generic | http://192.168.6.48:8041/v1/resource/generic |
| ipmi | http://192.168.6.48:8041/v1/resource/ipmi |
| image | http://192.168.6.48:8041/v1/resource/image |
| swift_account | http://192.168.6.48:8041/v1/resource/swift_account |
| volume | http://192.168.6.48:8041/v1/resource/volume |
| instance_network_interface | http://192.168.6.48:8041/v1/resource/instance_network_interface |
| instance_disk | http://192.168.6.48:8041/v1/resource/instance_disk |
| stack | http://192.168.6.48:8041/v1/resource/stack |
| identity | http://192.168.6.48:8041/v1/resource/identity |
+----------------------------+-----------------------------------------------------------------+
4.2 调用gnocchi resource list可以看到当前所有的资源信息
gnocchi resource list
+-----------------------------------+----------------------------+----------------------------------+----------------------------------+-----------------------------------+----------------------------------+----------+----------------------------------+--------------+
| id | type | project_id | user_id | original_resource_id | started_at | ended_at | revision_start | revision_end |
+-----------------------------------+----------------------------+----------------------------------+----------------------------------+-----------------------------------+----------------------------------+----------+----------------------------------+--------------+
| 5e3fcbe2-7aab-475d-b42c- | generic | None | None | None | 2016-04-21T10:02:03.791169+00:00 | None | 2016-04-21T10:02:03.791194+00:00 | None |
| a440aa42e5ad | | | | | | | | |
| 81930c5e-915a-447e- | swift_account | 81930c5e915a447ebd472d6675b84140 | None | 81930c5e915a447ebd472d6675b84140 | 2016-04-21T10:35:52.011266+00:00 | None | 2016-04-21T10:35:52.011281+00:00 | None |
| bd47-2d6675b84140 | | | | | | | | |
+-----------------------------------+----------------------------+----------------------------------+----------------------------------+-----------------------------------+----------------------------------+----------+----------------------------------+--------------+
4.3 调用 gnocchi --debug measures show 可以看到已经上报到gnocchi的采样信息
gnocchi measures show --resource-id 81930c5e-915a-447e-bd47-2d6675b84140 --aggregation min storage.objects.containers
+---------------------------+-------------+-------+
| timestamp | granularity | value |
+---------------------------+-------------+-------+
| 2016-04-23T02:27:02+00:00 | 1.0 | 2 |
| 2016-04-23T02:27:30+00:00 | 1.0 | 2 |