3.2. 设置监控客户端参数
监控解决方案定期收集系统信息,并提供使用数据收集代理以各种方式存储和监控值的机制。红帽支持 collectd 作为集合代理。collectd-sensubility 是 collectd 的扩展,并通过 RabbitMQ 与 Sensu 服务器端通信。您可以使用 Service Telemetry Framework (STF)存储数据,并依次监控系统、查找性能瓶颈和预测将来的系统负载。有关 Service Telemetry Framework 的更多信息,请参阅 Service Telemetry Framework 1.3 指南。
要配置 collectd 和 collectd-sensubility,请完成以下步骤:
在主目录中创建
config.yaml,如/home/templates/custom,并将MetricsQdrConnectors参数配置为指向 STF 服务器端:MetricsQdrConnectors: - host: qdr-normal-sa-telemetry.apps.remote.tld port: 443 role: inter-router sslProfile: sslProfile verifyHostname: false MetricsQdrSSLProfiles: - name: sslProfile在
config.yaml文件中,列出在CollectdExtraPlugins下要使用的插件。您还可以在ExtraConfig部分中提供参数。默认情况下,collectd 附带cpu、df、disk、hugepages、interface、load、内存、进程、tcpconns、UNIXsock和uptime插件。您可以使用CollectdExtraPlugins参数添加额外的插件。您还可以使用ExtraConfig选项为CollectdExtraPlugins提供额外的配置信息。例如,要启用virt插件并配置连接字符串和主机名格式,请使用以下语法:parameter_defaults: CollectdExtraPlugins: - disk - df - virt ExtraConfig: collectd::plugin::virt::connection: "qemu:///system" collectd::plugin::virt::hostname_format: "hostname uuid"注意不要删除
unixsock插件。删除会导致将 collectd 容器标记为不健康。可选: 要通过 AMQ Interconnect 收集指标和事件数据,请将
MetricsQdrExternalEndpoint: true行添加到config.yaml文件中:parameter_defaults: MetricsQdrExternalEndpoint: true要启用 collectd-sensubility,请在
config.yaml文件中添加以下环境配置:parameter_defaults: CollectdEnableSensubility: true # Use this if there is restricted access for your checks by using the sudo command. # The rule will be created in /etc/sudoers.d for sensubility to enable it calling restricted commands via sensubility executor. CollectdSensubilityExecSudoRule: "collectd ALL = NOPASSWD: <some command or ALL for all commands>" # Connection URL to Sensu server side for reporting check results. CollectdSensubilityConnection: "amqp://sensu:sensu@<sensu server side IP>:5672//sensu" # Interval in seconds for sending keepalive messages to Sensu server side. CollectdSensubilityKeepaliveInterval: 20 # Path to temporary directory where the check scripts are created. CollectdSensubilityTmpDir: /var/tmp/collectd-sensubility-checks # Path to shell used for executing check scripts. CollectdSensubilityShellPath: /usr/bin/sh # To improve check execution rate use this parameter and value to change the number of goroutines spawned for executing check scripts. CollectdSensubilityWorkerCount: 2 # JSON-formatted definition of standalone checks to be scheduled on client side. If you need to schedule checks # on overcloud nodes instead of Sensu server, use this parameter. Configuration is compatible with Sensu check definition. # For more information, see https://docs.sensu.io/sensu-core/1.7/reference/checks/#check-definition-specification # There are some configuration options which sensubility ignores such as: extension, publish, cron, stdin, hooks. CollectdSensubilityChecks: example: command: "ping -c1 -W1 8.8.8.8" interval: 30 # The following parameters are used to modify standard, standalone checks for monitoring container health on overcloud nodes. # Do not modify these parameters. # CollectdEnableContainerHealthCheck: true # CollectdContainerHealthCheckCommand: <snip> # CollectdContainerHealthCheckInterval: 10 # The Sensu server side event handler to use for events created by the container health check. # CollectdContainerHealthCheckHandlers: # - handle-container-health-check # CollectdContainerHealthCheckOccurrences: 3 # CollectdContainerHealthCheckRefresh: 90部署 overcloud。在 overcloud deploy 命令中包含
config.yaml、collectd-write-文件:qdr.yaml以及其中一个 qdrjpeg.yaml$ openstack overcloud deploy -e /home/templates/custom/config.yaml -e tripleo-heat-templates/environments/metrics/collectd-write-qdr.yaml -e tripleo-heat-templates/environments/metrics/qdr-form-controller-mesh.yaml-
可选: 要启用 overcloud RabbitMQ 监控,请在
overcloud deploy命令中包含collectd-read-rabbitmq.yaml文件。
其他资源
- 有关 YAML 文件的详情请参考 第 3.5 节 “YAML 文件”。
- 有关 collectd 插件的更多信息,请参阅 第 3.4 节 “collectd 插件配置”。
- 有关 Service Telemetry Framework 的更多信息,请参阅 Service Telemetry Framework 1.3 指南。