启用块存储计量器,适用于 Red Hat Enterprise Linux 和 CentOS

Telemetry 使用通知来收集块存储服务的计量器。请在控制器节点和块存储节点上执行以下步骤。

注意

您的环境必须包含块存储服务。

配置 Cinder 使用 Telemetry

编辑 /etc/cinder/cinder.conf 文件并完成以下操作

  • [oslo_messaging_notifications] 部分,配置通知

    [oslo_messaging_notifications]
    ...
    driver = messagingv2
    
  • 启用与块存储相关的定期使用情况统计信息。要使用它,您必须以以下格式运行此命令

    $ cinder-volume-usage-audit  --start_time='YYYY-MM-DD HH:MM:SS' \
      --end_time='YYYY-MM-DD HH:MM:SS' --send_actions
    

    此脚本会输出在给定时间内创建、删除或存在的卷或快照,以及关于这些卷或快照的一些信息。

    通过 cron 使用此脚本,您可以定期获取通知,例如,每 5 分钟

    */5 * * * * /path/to/cinder-volume-usage-audit --send_actions
    

完成安装

  1. 重启控制器节点上的块存储服务

    # systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service
    
  2. 重启存储节点上的块存储服务

    # systemctl restart openstack-cinder-volume.service