第 4 章 为 Service Telemetry Framework 配置 Red Hat OpenStack Platform director
要收集指标、事件或两者,并将其发送到 Service Telemetry Framework (STF)存储域,您必须配置 Red Hat OpenStack Platform (RHOSP) overcloud 以启用数据收集和传输。
STF 可以同时支持单和多个云。为单个云安装设置 RHOSP 和 STF 的默认配置。
- 有关使用默认配置的单个 RHOSP overcloud 部署,请参阅 第 4.1 节 “使用 director 为 Service Telemetry Framework 部署 Red Hat OpenStack Platform overcloud”。
- 要规划多个云的 RHOSP 安装和配置 STF,请参阅 第 4.3 节 “配置多个云”。
作为 RHOSP overcloud 部署的一部分,您可能需要在环境中配置其他功能:
4.1. 使用 director 为 Service Telemetry Framework 部署 Red Hat OpenStack Platform overcloud
作为使用 director 的 Red Hat OpenStack Platform (RHOSP) overcloud 部署的一部分,您必须配置数据收集器和数据传输到 Service Telemetry Framework (STF)。
其他资源
- 有关使用 director 部署 OpenStack 云的更多信息,请参阅 Director 安装和使用。
- 要通过 AMQ Interconnect 收集数据,请参阅 amqp1 插件。
4.1.1. 检索 AMQ Interconnect 路由地址
当您为 Service Telemetry Framework (STF)配置 Red Hat OpenStack Platform (RHOSP) overcloud 时,您必须在 STF 连接文件中提供 AMQ Interconnect 路由地址。
流程
- 登录到托管 STF 的 Red Hat OpenShift Container Platform 环境。
进入
service-telemetry项目:$ oc project service-telemetry
检索 AMQ Interconnect 路由地址:
$ oc get routes -ogo-template='{{ range .items }}{{printf "%s\n" .spec.host }}{{ end }}' | grep "\-5671" default-interconnect-5671-service-telemetry.apps.infra.watch
4.1.2. 为 STF 创建基本配置
要配置基础参数,以便为 Service Telemetry Framework (STF)提供兼容数据收集和传输,您必须创建一个定义默认数据收集值的文件。
流程
-
以
stack用户身份登录 undercloud 主机。 在
/home/stack目录中创建一个名为enable-stf.yaml的配置文件。重要将
EventPipelinePublishers和PipelinePublishers设置为空列表会导致没有事件或指标数据传递给 RHOSP 遥测组件,如 Gnocchi 或 Panko。如果您需要将数据发送到其他管道,Ceilometer 轮询间隔为30秒,您在ExtraConfig中指定,可能会认为 RHOSP 遥测组件。您必须将间隔增加到较大的值,如300,这会减少 STF 中的遥测解析。
enable-stf.yaml
parameter_defaults:
# only send to STF, not other publishers
EventPipelinePublishers: []
PipelinePublishers: []
# manage the polling and pipeline configuration files for Ceilometer agents
ManagePolling: true
ManagePipeline: true
# enable Ceilometer metrics and events
CeilometerQdrPublishMetrics: true
CeilometerQdrPublishEvents: true
# enable collection of API status
CollectdEnableSensubility: true
CollectdSensubilityTransport: amqp1
# enable collection of containerized service metrics
CollectdEnableLibpodstats: true
# set collectd overrides for higher telemetry resolution and extra plugins
# to load
CollectdConnectionType: amqp1
CollectdAmqpInterval: 5
CollectdDefaultPollingInterval: 5
CollectdExtraPlugins:
- vmem
# set standard prefixes for where metrics and events are published to QDR
MetricsQdrAddresses:
- prefix: 'collectd'
distribution: multicast
- prefix: 'anycast/ceilometer'
distribution: multicast
ExtraConfig:
ceilometer::agent::polling::polling_interval: 30
ceilometer::agent::polling::polling_meters:
- cpu
- disk.*
- ip.*
- image.*
- memory
- memory.*
- network.services.vpn.*
- network.services.firewall.*
- perf.*
- port
- port.*
- switch
- switch.*
- storage.*
- volume.*
# to avoid filling the memory buffers if disconnected from the message bus
# note: this may need an adjustment if there are many metrics to be sent.
collectd::plugin::amqp1::send_queue_limit: 5000
# receive extra information about virtual memory
collectd::plugin::vmem::verbose: true
# provide name and uuid in addition to hostname for better correlation
# to ceilometer data
collectd::plugin::virt::hostname_format: "name uuid hostname"
# provide the human-friendly name of the virtual instance
collectd::plugin::virt::plugin_instance_format: metadata
# set memcached collectd plugin to report its metrics by hostname
# rather than host IP, ensuring metrics in the dashboard remain uniform
collectd::plugin::memcached::instances:
local:
host: "%{hiera('fqdn_canonical')}"
port: 11211
4.1.3. 为 overcloud 配置 STF 连接
要配置 Service Telemetry Framework (STF)连接,您必须创建一个文件,其中包含将 overcloud 到 STF 部署的 AMQ Interconnect 的连接配置。启用 STF 中事件和存储的事件和存储,并部署 overcloud。默认配置用于带有默认消息总线主题的单一云实例。有关配置多个云部署的信息,请参阅 第 4.3 节 “配置多个云”。
前提条件
- 检索 AMQ Interconnect 路由地址。更多信息请参阅 第 4.1.1 节 “检索 AMQ Interconnect 路由地址”。
流程
-
以
stack用户身份登录 undercloud 主机。 -
在
/home/stack目录中创建一个名为stf-connectors.yaml的配置文件。 在
stf-connectors.yaml文件中,配置MetricsQdrConnectors地址,将 overcloud 上的 AMQ Interconnect 连接到 STF 部署。您可以为此文件中的 Sensubility、Chtrace 和 collectd 配置主题地址,以匹配 STF 中的默认值。有关自定义主题和云配置的详情,请参考 第 4.3 节 “配置多个云”。stf-connectors.yaml
resource_registry: OS::TripleO::Services::Collectd: /usr/share/openstack-tripleo-heat-templates/deployment/metrics/collectd-container-puppet.yaml parameter_defaults: MetricsQdrConnectors: - host: default-interconnect-5671-service-telemetry.apps.infra.watch port: 443 role: edge verifyHostname: false sslProfile: sslProfile MetricsQdrSSLProfiles: - name: sslProfile CeilometerQdrEventsConfig: driver: amqp topic: cloud1-event CeilometerQdrMetricsConfig: driver: amqp topic: cloud1-metering CollectdAmqpInstances: cloud1-notify: notify: true format: JSON presettle: false cloud1-telemetry: format: JSON presettle: false CollectdSensubilityResultsChannel: sensubility/cloud1-telemetry-
resource_registry配置直接加载 collectd 服务,因为您不包含用于多个云部署的collectd-write-qdr.yaml环境文件。 -
将
host参数替换为您在 第 4.1.1 节 “检索 AMQ Interconnect 路由地址” 中检索的值。 -
将
MetricsQdrConnectors的主机子参数替换为您在 第 4.1.1 节 “检索 AMQ Interconnect 路由地址” 中检索的值。 -
设置
CeilometerQdrEventsConfig的主题值,以定义 Ceilometer 事件的主题。该值是云的唯一主题限定符,如cloud1-event。 -
设置
CeilometerQdrMetricsConfig.值,以定义 Ceilometer 指标的主题。该值是云的唯一标识符,如topic的主题cloud1-metering。 -
设置
CollectdAmqpInstances子参数,以定义 collectd 事件的主题。部分名称是云的唯一标识符,如cloud1-notify。 -
设置
CollectdAmqpInstances子参数,以定义 collectd 指标的主题。部分名称是云的唯一标识符,如cloud1-telemetry。 -
设置
CollectdSensubilityResultsChannel,以定义 collectd-sensubility 事件的主题。该值是云的唯一主题标识符,如sensubility/cloud1-telemetry。
-
当您为 collectd 和 Ceilometer 定义主题时,您提供的值将转换为智能网关客户端用于侦听消息的完整主题。
Ceilometer 主题值被转换为主题地址 anycast/ceilometer/<TOPIC>.sample,collectd 主题值被转换为主题地址 collectd/<TOPIC>。sensubility 的值是完整主题路径,且没有从主题值转换为主题地址。
有关 ServiceTelemetry 对象中的云配置示例,请参阅 “clouds 参数”一节。
4.1.4. 部署 overcloud
使用所需的环境文件部署或更新 overcloud,以便收集数据并传输到 Service Telemetry Framework (STF)。
流程
-
以
stack用户身份登录 undercloud 主机。 查找
stackrcundercloud 凭证文件:$ source ~/stackrc
使用其他环境文件将数据收集和 AMQ Interconnect 环境文件添加到堆栈中,并部署 overcloud:
(undercloud)$ openstack overcloud deploy --templates \ -e [your environment files] \ -e /usr/share/openstack-tripleo-heat-templates/environments/metrics/ceilometer-write-qdr.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/metrics/qdr-edge-only.yaml \ -e /home/stack/enable-stf.yaml \ -e /home/stack/stf-connectors.yaml
-
包含
ceilometer-write-qdr.yaml文件,以确保 Ceilometer 遥测和事件发送到 STF。 -
包含
qdr-edge-only.yaml文件,以确保消息总线已启用并连接到 STF 消息总线路由器。 -
包含
enable-stf.yaml环境文件,以确保正确配置了默认值。 -
包含
stf-connectors.yaml环境文件以定义与 STF 的连接。
-
包含
4.1.5. 验证客户端安装
要验证 Service Telemetry Framework (STF)存储域的数据收集,请查询数据源以获取交付的数据。要验证 Red Hat OpenStack Platform (RHOSP)部署中单个节点,请使用 SSH 连接到控制台。
只有在 RHOSP 有活跃工作负载时,一些遥测数据才可用。
流程
- 登录 overcloud 节点,如 controller-0。
确保
metrics_qdr和 collection 代理容器在节点上运行:$ sudo podman container inspect --format '{{.State.Status}}' metrics_qdr collectd ceilometer_agent_notification ceilometer_agent_central running running running running注意在计算节点上使用以下命令:
$ sudo podman container inspect --format '{{.State.Status}}' metrics_qdr collectd ceilometer_agent_compute返回运行 AMQ Interconnect 的内部网络地址,例如
172.17.1.44侦听端口5666:$ sudo podman exec -it metrics_qdr cat /etc/qpid-dispatch/qdrouterd.conf listener { host: 172.17.1.44 port: 5666 authenticatePeer: no saslMechanisms: ANONYMOUS }返回到本地 AMQ Interconnect 的连接列表:
$ sudo podman exec -it metrics_qdr qdstat --bus=172.17.1.44:5666 --connections Connections id host container role dir security authentication tenant ============================================================================================================================================================================================================================================================================================ 1 default-interconnect-5671-service-telemetry.apps.infra.watch:443 default-interconnect-7458fd4d69-bgzfb edge out TLSv1.2(DHE-RSA-AES256-GCM-SHA384) anonymous-user 12 172.17.1.44:60290 openstack.org/om/container/controller-0/ceilometer-agent-notification/25/5c02cee550f143ec9ea030db5cccba14 normal in no-security no-auth 16 172.17.1.44:36408 metrics normal in no-security anonymous-user 899 172.17.1.44:39500 10a2e99d-1b8a-4329-b48c-4335e5f75c84 normal in no-security no-auth
有四个连接:
- 到 STF 的出站连接
- 来自 ceilometer 的入站连接
- 来自 collectd 的入站连接
来自
qdstat客户端的入站连接出站 STF 连接提供给
MetricsQdrConnectors主机参数,是 STF 存储域的路由。其他主机是到此 AMQ Interconnect 的客户端连接的内部网络地址。
要确保发送消息,列出链接,并在
deliv列中查看发送消息的_edge地址:$ sudo podman exec -it metrics_qdr qdstat --bus=172.17.1.44:5666 --links Router Links type dir conn id id peer class addr phs cap pri undel unsett deliv presett psdrop acc rej rel mod delay rate =========================================================================================================================================================== endpoint out 1 5 local _edge 250 0 0 0 2979926 0 0 0 0 2979926 0 0 0 endpoint in 1 6 250 0 0 0 0 0 0 0 0 0 0 0 0 endpoint in 1 7 250 0 0 0 0 0 0 0 0 0 0 0 0 endpoint out 1 8 250 0 0 0 0 0 0 0 0 0 0 0 0 endpoint in 1 9 250 0 0 0 0 0 0 0 0 0 0 0 0 endpoint out 1 10 250 0 0 0 911 911 0 0 0 0 0 911 0 endpoint in 1 11 250 0 0 0 0 911 0 0 0 0 0 0 0 endpoint out 12 32 local temp.lSY6Mcicol4J2Kp 250 0 0 0 0 0 0 0 0 0 0 0 0 endpoint in 16 41 250 0 0 0 2979924 0 0 0 0 2979924 0 0 0 endpoint in 912 1834 mobile $management 0 250 0 0 0 1 0 0 1 0 0 0 0 0 endpoint out 912 1835 local temp.9Ok2resI9tmt+CT 250 0 0 0 0 0 0 0 0 0 0 0 0
要列出 RHOSP 节点到 STF 的地址,请连接到 Red Hat OpenShift Container Platform 以检索 AMQ Interconnect pod 名称并列出连接。列出可用的 AMQ Interconnect pod:
$ oc get pods -l application=default-interconnect NAME READY STATUS RESTARTS AGE default-interconnect-7458fd4d69-bgzfb 1/1 Running 0 6d21h
连接到 pod 并列出已知的连接。在本例中,有来自 RHOSP 节点的三个
边缘连接,其连接id为 22, 23, 和 24。$ oc exec -it default-interconnect-7458fd4d69-bgzfb -- qdstat --connections 2020-04-21 18:25:47.243852 UTC default-interconnect-7458fd4d69-bgzfb Connections id host container role dir security authentication tenant last dlv uptime =============================================================================================================================================================================================== 5 10.129.0.110:48498 bridge-3f5 edge in no-security anonymous-user 000:00:00:02 000:17:36:29 6 10.129.0.111:43254 rcv[default-cloud1-ceil-meter-smartgateway-58f885c76d-xmxwn] edge in no-security anonymous-user 000:00:00:02 000:17:36:20 7 10.130.0.109:50518 rcv[default-cloud1-coll-event-smartgateway-58fbbd4485-rl9bd] normal in no-security anonymous-user - 000:17:36:11 8 10.130.0.110:33802 rcv[default-cloud1-ceil-event-smartgateway-6cfb65478c-g5q82] normal in no-security anonymous-user 000:01:26:18 000:17:36:05 22 10.128.0.1:51948 Router.ceph-0.redhat.local edge in TLSv1/SSLv3(DHE-RSA-AES256-GCM-SHA384) anonymous-user 000:00:00:03 000:22:08:43 23 10.128.0.1:51950 Router.compute-0.redhat.local edge in TLSv1/SSLv3(DHE-RSA-AES256-GCM-SHA384) anonymous-user 000:00:00:03 000:22:08:43 24 10.128.0.1:52082 Router.controller-0.redhat.local edge in TLSv1/SSLv3(DHE-RSA-AES256-GCM-SHA384) anonymous-user 000:00:00:00 000:22:08:34 27 127.0.0.1:42202 c2f541c1-4c97-4b37-a189-a396c08fb079 normal in no-security no-auth 000:00:00:00 000:00:00:00
要查看网络发送的消息数量,请使用
oc exec命令的每个地址:$ oc exec -it default-interconnect-7458fd4d69-bgzfb -- qdstat --address 2020-04-21 18:20:10.293258 UTC default-interconnect-7458fd4d69-bgzfb Router Addresses class addr phs distrib pri local remote in out thru fallback ========================================================================================================================== mobile anycast/ceilometer/event.sample 0 balanced - 1 0 970 970 0 0 mobile anycast/ceilometer/metering.sample 0 balanced - 1 0 2,344,833 2,344,833 0 0 mobile collectd/notify 0 multicast - 1 0 70 70 0 0 mobile collectd/telemetry 0 multicast - 1 0 216,128,890 216,128,890 0 0