第 4 章 为服务 Telemetry Framework 配置 Red Hat OpenStack Platform


要收集指标、事件或两个对象,并将其发送到服务遥测框架(STF)存储域,您必须配置 Red Hat OpenStack Platform (RHOSP) overcloud 以启用数据收集和传输。

STF 可支持单一和多个云。RHOSP 和 STF 中的默认配置为单个云安装设置。

作为 Red Hat OpenStack Platform (RHOSP) overcloud 部署的一部分,您必须配置数据收集器,并将数据传输配置为 Service Telemetry Framework (STF)。

要将 Red Hat OpenStack Platform overcloud 连接到 Service Telemetry Framework (STF),检索在 Service Telemetry Framework 中运行的 AMQ Interconnect 的 CA 证书,并使用 Red Hat OpenStack Platform 配置中的证书。

流程

  1. 查看 Service Telemetry Framework 中的可用证书列表:

    $ oc get secrets
  2. 检索并记录 default-interconnect-selfsigned Secret 的内容:

    $ oc get secret/default-interconnect-selfsigned -o jsonpath='{.data.ca\.crt}' | base64 -d

4.1.2. 检索 AMQ Interconnect 路由地址

为服务 Telemetry Framework (STF)配置 Red Hat OpenStack Platform (RHOSP) overcloud 时,必须在 STF 连接文件中提供 AMQ Interconnect 路由地址。

流程

  1. 登录您的 Red Hat OpenShift Container Platform 环境。
  2. 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.3. 为 STF 创建基本配置

要配置基础参数,以便为服务 Telemetry Framework (STF)提供兼容数据收集和传输,您必须创建一个定义默认数据收集值的文件。

流程

  1. stack 用户身份登录 Red Hat OpenStack Platform (RHOSP) undercloud。
  2. /home/stack 目录中创建一个名为 enable-stf.yaml 的配置文件。

    重要

    EventPipelinePublishersPipelinePublishers 设置为空列表会导致事件或指标数据传递到 RHOSP 遥测组件,如 Gnocchi 或 Panko。如果您需要将数据发送到其他管道,CeiloConfig 轮询间隔为 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
    
        # 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.*
            - perf.*
            - port
            - port.*
            - switch
            - switch.*
            - storage.*
            - volume.*
    
            # to avoid filling the memory buffers if disconnected from the message bus
            # note: Adjust the value of the `send_queue_limit` to handle your required volume of metrics.
            collectd::plugin::amqp1::send_queue_limit: 5000
    
            # receive extra information about virtual memory
            collectd::plugin::vmem::verbose: true
    
            # 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
    
            # align defaults across OSP versions
            collectd::plugin::cpu::reportbycpu: true
            collectd::plugin::cpu::reportbystate: true
            collectd::plugin::cpu::reportnumcpu: false
            collectd::plugin::cpu::valuespercentage: true
            collectd::plugin::df::ignoreselected: true
            collectd::plugin::df::reportbydevice: true
            collectd::plugin::df::fstypes: ['xfs']
            collectd::plugin::load::reportrelative: true
            collectd::plugin::virt::extra_stats: "pcpu cpu_util vcpupin vcpu memory disk disk_err disk_allocation disk_capacity disk_physical domain_state job_stats_background perf"

4.1.4. 为 overcloud 配置 STF 连接

要配置 Service Telemetry Framework (STF)连接,您必须创建一个文件,其中包含用于 overcloud 的 AMQ Interconnect 的连接配置到 STF 部署。启用 STF 中事件的事件和存储的集合,并且部署 overcloud。默认配置适用于具有默认消息总线主题的单一云实例。有关配置多个云部署,请参阅 第 4.5 节 “配置多个云”

先决条件

流程

  1. stack 用户身份登录到 RHOSP undercloud。
  2. /home/stack 目录中创建一个名为 stf-connectors.yaml 的配置文件。
  3. stf-connectors.yaml 文件中,配置 MetricsQdrConnectors 地址,将 overcloud 上的 AMQ Interconnect 连接到 STF 部署。您可以在此文件中为 Sensubility、Ceilometer 和 collectd 配置主题地址,以匹配 STF 中的默认值。有关自定义主题和云配置的更多信息,请参阅 第 4.5 节 “配置多个云”

    • resource_registry 配置直接加载 collectd 服务,因为您不为多个云部署包含 collectd-write-qdr.yaml 环境文件。
    • host 参数替换为您在 第 4.1.2 节 “检索 AMQ Interconnect 路由地址” 中检索的 HOST/PORT 值。
    • caCertFileContent 参数替换为在 第 4.1.1 节 “从用于 overcloud 配置的服务 Telemetry Framework 获取 CA 证书” 中检索的内容。
    • MetricsQdrConnectors 的主机 子参数替换为您在 第 4.1.2 节 “检索 AMQ Interconnect 路由地址” 中检索的 HOST/PORT 的值。
    • 设置 CeilometerQdrEventsConfig.topic,以定义 Ceilometer 事件的主题。这个值的格式为 anycast/ceilometer/cloud1-event.sample
    • 设置 CeilometerQdrMetricsConfig.topic,以定义 Ceilometer 指标的主题。这个值的格式为 anycast/ceilometer/cloud1-metering.sample
    • 设置 CollectdAmqpInstances,以定义 collectd 事件的主题。这个值的格式为 collectd/cloud1-notify
    • 设置 CollectdAmqpInstances,以定义 collectd 指标的主题。这个值的格式为 collectd/cloud1-telemetry

      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: stf-default-interconnect-5671-service-telemetry.apps.infra.watch
                port: 443
                role: edge
                verifyHostname: false
                sslProfile: sslProfile
      
          MetricsQdrSSLProfiles:
              - name: sslProfile
                caCertFileContent: |
                  -----BEGIN CERTIFICATE-----
                  <snip>
                  -----END CERTIFICATE-----
      
          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

4.1.5. 部署 overcloud

使用所需的环境文件部署或更新 overcloud,以便收集数据并将其传输到服务遥测框架(STF)。

流程

  1. stack 用户身份登录 Red Hat OpenStack Platform (RHOSP) undercloud。
  2. 提供身份验证文件:

    [stack@undercloud-0 ~]$ source stackrc
    
    (undercloud) [stack@undercloud-0 ~]$
  3. 在 RHOSP director 部署中添加以下文件来配置数据收集和 AMQ Interconnect:

    • ceilometer-write-qdr.yaml 文件,以确保 Ceilometer 遥测和事件发送到 STF
    • qdr-edge-only.yaml 文件,以确保消息总线被启用并连接到 STF 消息总线路由器
    • enable-stf.yaml 环境文件,以确保正确配置了默认值
    • stf-connectors.yaml 环境文件来定义到 STF 的连接
  4. 部署 RHOSP overcloud:

    (undercloud) [stack@undercloud-0 ~]$ openstack overcloud deploy <other_arguments>
    --templates /usr/share/openstack-tripleo-heat-templates \
      --environment-file <...other_environment_files...> \
      --environment-file /usr/share/openstack-tripleo-heat-templates/environments/metrics/ceilometer-write-qdr.yaml \
      --environment-file /usr/share/openstack-tripleo-heat-templates/environments/metrics/qdr-edge-only.yaml \
      --environment-file /home/stack/enable-stf.yaml \
      --environment-file /home/stack/stf-connectors.yaml

4.1.6. 验证客户端安装

要验证 Service Telemetry Framework (STF)存储域的数据收集,请查询数据源以传送数据。要在 Red Hat OpenStack Platform (RHOSP)部署中验证单个节点,请使用 SSH 连接到控制台。

提示

某些遥测数据仅在 RHOSP 具有活跃工作负载时才可用。

流程

  1. 登录 overcloud 节点,如 controller-0。
  2. 确保 metrics_qdr 容器在节点上运行:

    $ sudo docker container inspect --format '{{.State.Status}}' metrics_qdr
    
    running
  3. 返回运行 AMQ Interconnect 的内部网络地址,如 172.17.1.44 侦听端口 5666

    $ sudo docker exec -it metrics_qdr cat /etc/qpid-dispatch/qdrouterd.conf
    
    listener {
        host: 172.17.1.44
        port: 5666
        authenticatePeer: no
        saslMechanisms: ANONYMOUS
    }
  4. 返回到本地 AMQ Interconnect 的连接列表:

    $ sudo docker 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 的客户端连接的内部网络地址。

  5. 为确保传递信息,列出链接,并在 deliv 列中查看用于传递消息的 _edge 地址:

    $ sudo docker 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
  6. 要列出来自 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
  7. 连接到 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
  8. 要查看网络发送的消息数量,请使用 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
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部