ceilometer + gnocchi + aodh集成(003) ---- ceilometer对接gnocchi

一、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 |

  

    

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值