Telemetry 提供一个监控和检测 OpenStack 云的框架。也就是大家所知道的 ceilometer 项目。
Telemetry 模块表现有如下功能:
Efficiently polls metering data related to OpenStack services.
Collects event and metering data by monitoring notifications sent from services.
Publishes collected data to various targets including data stores and message queues.
Creates alarms when collected data breaks defined rules.
Telemetry 模块通常包含下面组件:
A compute agent (ceilometer-agent-compute)
运行在每个计算节点中,推送资源的使用状态,也许在未来会有其他类型的代理,但是目前来说社区专注于创建计算节点代理。A central agent (ceilometer-agent-central)
Runs on a central management server to poll for resource utilization statistics for resources not tied to instances or compute nodes. Multiple agents can be started to scale service horizontally.A notification agent (ceilometer-agent-notification)
Runs on a central management server(s) and consumes messages from the message queue(s) to build event and metering data.A collector (ceilometer-collector)
运行在一个或多个中心管理服务器,当警告发生是由于相关联的统计趋势超过阈值以上的滑动时间窗口,然后作出决定。An alarm evaluator (ceilometer-alarm-evaluator)
运行在一个或多个中心管理服务器,允许警告为一组收集的实例基于评估阀值来设置。An alarm notifier (ceilometer-alarm-notifier)
Runs on one or more central management servers to allow alarms to be set based on the threshold evaluation for a collection of samples.An API server (ceilometer-api)
运行在一个或多个中心管理服务器,提供从数据存储的数据访问。
这些服务使用OpenStack消息总线来通信,只有收集者和API服务可以访问数据存储。
Install and configure controller node
Telemetry模块使用分离的代理来从您环境的 OpenStack 服务中收集评估。
安装 MongoDB package:
# |
编辑 /etc/mongod.conf 文件:
# |
启动 MongoDB 服务并将其配置为随系统启动:
# |
创建 ceilometer database:
# |
导入 admin身份凭证以执行管理员用户专有的命令:
# |
创建 ceilometer user:
# |
添加 admin role to the ceilometer user.
# |
创建 ceilometer service entity:
# |
创建 Telemetry module API endpoint:
# |
安装软件包:
# |
Generate a random value to use as the telemetry secret:
# |
编辑 /etc/ceilometer/ceilometer.conf 文件:
# |
启动Telemetry服务并将其配置为随系统启动:
# |
Configure the Compute service
Telemetry uses a combination of notifications and an agent to collect Compute metrics. Perform these steps on each compute node.
安装软件包:
# |
编辑 /etc/ceilometer/ceilometer.conf 文件:
# |
Configure the Compute service to send notifications to the message bus.
修改配置文件 /etc/nova/nova.conf并在 [DEFAULT]部分配置消息机制:
# |
Start the Telemetry agent and configure it to start when the system boots:
# |
重启 Compute service:
# |
Configure the Image service
To retrieve image-oriented events and samples, configure the Image service to send notifications to the message bus. Perform these steps on the controller node.
编辑 /etc/glance/glance-api.conf 和 /etc/glance/glance-registry.conf 文件:
# |
重启Image service:
# |
Configure the Block Storage service
To retrieve volume-oriented events and samples, you must configure the Block Storage service to send notifications to the message bus. Perform these steps on the controller and storage nodes.
编辑 /etc/cinder/cinder.conf :
# |
重启 Block Storage services on the storage nodes:
# |
重启 Block Storage services on the controller node:
# |
Use the cinder-volume-usage-audit
command to retrieve metrics on demand. For more information, see Block Storage audit script setup to get notifications.
Configure the Object Storage service
To retrieve storage-oriented events and samples, configure the Object Storage service to send notifications to the message bus.
The Telemetry service requires access to the Object Storage service using the ResellerAdmin role. Perform these steps on the controller node.
Source the admin credentials to gain access to admin-only CLI commands.
# |
Create the ResellerAdmin role:
# |
添加 ResellerAdmin role to the service tenant and ceilometer user:
# |
Perform these steps on the controller and any other nodes that run the Object Storage proxy service.
编辑 /etc/swift/proxy-server.conf 文件:
echo " |
Add the swift system user to the ceilometer system group to permit access to the Telemetry configuration files by the Object Storage service:
# |
安装 ceilometermiddleware package:
# |
重启 the Object Storage proxy service:
# |
Verify the Telemetry installation
This section describes how to verify operation of the Telemetry module.
[Note] Note
Perform these steps on the controller node.
Source the admin credentials to gain access to admin-only CLI commands:
# |
List available meters:
# |
Download an image from the Image service:
# |
List available meters again to validate detection of the image download:
# |
Retrieve usage statistics from the image.download meter:
# |
Remove the previously downloaded image file /tmp/cirros.img:
# |