使用 Datadog 指南监控 Ceph


Red Hat Ceph Storage 6

使用 Datadog 监控 Ceph 的指南

Red Hat Ceph Storage Documentation Team

摘要

本文档提供有关使用 Datadog 监控工具监控 Ceph 存储集群的状态的信息。
红帽承诺替换我们的代码、文档和网页属性中存在问题的语言。我们从这四个术语开始:master、slave、黑名单和白名单。由于此项工作十分艰巨,这些更改将在即将推出的几个发行版本中逐步实施。详情请查看 CTO Chris Wright 信息

第 1 章 监控 Datadog 和 Ceph

Datadog 与 Ceph 集成可让 Datadog 执行和处理输出:

  • Ceph 状态
  • Ceph 健康详情
  • ceph df 详情
  • Ceph osd perf; and,
  • Ceph osd pool stats

集成使 Datadog 能够:

  • 监控 Red Hat Ceph Storage 集群的状态和健康状况。
  • 监控 I/O 和性能指标。
  • 跟踪存储池的磁盘用量。

使用 Datadog

使用 Datadog 来监控 Ceph 需要在至少一个 Ceph 监控节点上安装 Datadog 代理。监控 Ceph 时,Datadog 代理将执行 Ceph 命令行参数。因此,每个 Ceph 节点都必须有适当的 Ceph 密钥来提供对集群的访问,通常在 /etc/ceph 中。代理执行 Ceph 命令后,它会发送 Red Hat Ceph Storage 集群状态,以及统计数据回 Datadog。然后,Datadog 将在 Datadog 用户界面中显示状态和统计信息。

由于 Datadog 使用代理,Red Hat Ceph Storage 集群必须能够访问互联网。但是,Red Hat Ceph Storage 集群不必从互联网访问。

注意

Datadog 支持通过 Red Hat Ceph Storage 版本 2 或更高版本来检索 ceph 状态。Datadog 将提供更新,在后续的 dd-agent 版本中支持 Red Hat Ceph Storage 3 集群的 ceph status

重要

红帽与我们的技术合作伙伴合作,将本文档作为为客户提供服务。但是,红帽不提供对这个产品的支持。如果您需要此产品的技术协助,请联系 Datadog 以获得支持。

第 2 章 为 Ceph 集成安装 Datadog

安装 Datadog 代理后,配置 Datadog 代理,以将 Ceph 指标报告为 Datadog。

先决条件

  • Ceph 监控节点的根级别访问权限。
  • 提供访问 Red Hat Ceph Storage 集群的适当 Ceph 密钥。
  • 互联网访问。

流程

  1. 安装 Ceph 集成。

    1. 登录 Datadog 应用程序。用户界面将在屏幕左侧的导航显示。
    2. Integrations
    3. 在搜索字段中输入 ceph,或滚动以查找 Ceph 集成。用户界面将会显示 Ceph 集成 是否可用
    4. 如果可用,请单击按钮以安装它。

  2. 为 Ceph 配置 Datadog 代理

    1. 进入 Datadog Agent 配置目录:

      [root@mon ~]# cd /etc/dd-agent/conf.d
      Copy to Clipboard Toggle word wrap
    2. ceph.yml.sample 文件创建一个 ceph.yaml 文件:

      [root@mon ~]# cp ceph.yaml.example ceph.yaml
      Copy to Clipboard Toggle word wrap
    3. 修改 ceph.yaml 文件:

      [root@mon ~]# vim ceph.yaml
      Copy to Clipboard Toggle word wrap

      示例

      以下是修改的 ceph.yaml 文件的示例。

      init_config:
      
      instances:
      #  - tags:
      #    - name:mars_cluster
      #
      #    ceph_cmd: /usr/bin/ceph
      #    ceph_cluster: ceph
      #
      # If your environment requires sudo, please add a line like:
      #          dd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph
      # to your sudoers file, and uncomment the below option.
      #
      #    use_sudo: True
      Copy to Clipboard Toggle word wrap

      取消注释 -tags-nameceph_commandceph_clusteruse_sudo: True 行。ceph_commandceph_cluster 的默认值为 /usr/bin/cephceph

      完成后,它将类似如下:

      init_config:
      
      instances:
        - tags:
          - name:ceph-RHEL
      #
          ceph_cmd: /usr/bin/ceph
          ceph_cluster: ceph
      #
      # If your environment requires sudo, please add a line like:
      #          dd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph
      # to your sudoers file, and uncomment the below option.
      #
          use_sudo: True
      Copy to Clipboard Toggle word wrap
    4. 修改 sudoers 文件:

      [root@mon ~]# visudo
      Copy to Clipboard Toggle word wrap
    5. 添加以下行:

      dd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph
      Copy to Clipboard Toggle word wrap
    6. 启用 Datadog 代理,以便在 Ceph 主机重启时重启:

      [root@mon ~]# systemctl enable datadog-agent
      Copy to Clipboard Toggle word wrap
    7. 重启 Datadog 代理:

      [root@mon ~]# systemctl status datadog-agent
      Copy to Clipboard Toggle word wrap

第 3 章 为 Ceph 安装和配置 Datadog 代理

安装 Ceph 的 Datadog 代理,并将它配置为将 Ceph 数据报告回 Datadog App。

先决条件

  • Ceph 监控节点的根级别访问权限。
  • 提供访问 Red Hat Ceph Storage 集群的适当 Ceph 密钥。
  • 互联网访问。

流程

  1. 登录 Datadog 应用程序。用户界面将在屏幕左侧的导航显示。
  2. Integrations。若要从命令行安装代理,请单击屏幕顶部的 Agent 选项卡。

  3. 打开命令行,并输入单步命令行代理安装。

    示例

    [root@mon ~]# DD_API_KEY=KEY-STRING bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh)"
    Copy to Clipboard Toggle word wrap

注意

从 Datadog 用户界面复制示例,因为键与上例和每个用户帐户不同。

第 4 章 使用 Datadog 查看 Ceph 概述

安装和配置 Datadog 与 Ceph 集成后,返回到 Datadog App。用户界面将在屏幕左侧的导航显示。

先决条件

  • 互联网访问。

流程

  1. 将鼠标悬停在 Dashboards 上,以公开子菜单,然后单击 Ceph Overview

    Datadog 显示 Ceph 存储集群的概述。

  2. Dashboards→New Dashboard 创建自定义 Ceph 仪表板。

第 5 章 Datadog 的 Ceph 指标

Datadog 代理从 Ceph 收集以下指标:这些指标可以包含在自定义仪表板和警报中。

Expand
指标名称描述

ceph.commit_latency_ms

将操作提交到日志的时间。

ceph.apply_latency_ms

刷新更新到磁盘的时间。

ceph.op_per_sec

给定池的每秒 I/O 操作数量。

ceph.read_bytes_sec

每秒读取的字节数。

ceph.write_bytes_sec

写入每秒的字节数。

ceph.num_osds

已知存储守护进程的数量。

ceph.num_in_osds

参与存储守护进程的数量。

ceph.num_up_osds

在线存储守护进程数量。

ceph.num_pgs

可用的放置组数量。

ceph.num_mons

监控守护进程的数量。

ceph.aggregate_pct_used

总容量使用量指标。

ceph.total_objects

来自底层对象存储的对象计数。

ceph.num_objects

给定池的对象计数。

ceph.read_bytes

每个池的读取字节数。

ceph.write_bytes

每个池的写入字节。

ceph.num_pools

池的数量。

ceph.pgstate.active_clean

active+clean 放置组的数量。

ceph.read_op_per_sec

每个池的读取操作每秒读取操作。

ceph.write_op_per_sec

每个池的写入操作每秒的写入操作。

ceph.num_near_full_osds

接近完整 OSD 的数量。

ceph.num_full_osds

完整 OSD 数量。

ceph.osd.pct_used

full 或 near-full OSD 使用的百分比。

第 6 章 在 Datadog 中创建警报

管理员可以创建监视器来跟踪 Red Hat Ceph Storage 集群的指标并生成警报。例如,如果 OSD 为 down,Datadog 可以提醒管理员一个或多个 OSD 为 down。

先决条件

  • Ceph 监控节点的根级别访问权限.
  • 提供访问 Red Hat Ceph Storage 集群的适当 Ceph 密钥。
  • 互联网访问。

流程

  1. 单击 monitor 以查看 Datadog 监视器的概述。

  2. 要创建监控器,请选择 Monitors→New Monitor
  3. 选择检测方法。例如,"Threshold Alert"。

  4. 定义指标。要创建高级警报,请点击 Advanced…​ 链接。然后,从组合框中选择一个指标。例如,选择 ceph.num_in_osds Ceph 指标。
  5. Add Query+ 添加另一个查询。

  6. 从组合框中选择另一个指标。例如,选择 ceph.num_up_osds Ceph 指标。

  7. Express these queries as: 字段中,输入 a-b,其中 aceph.num_in_osds 的值,bceph.num_up_osds 的值。当区别为 1 或更高时,至少有一个 OSD 停机。
  8. 设置警报条件。例如,将触发器设置为 高于或等于,阈值 的总数以及总时间1 分钟
  9. Alert threshold 字段设置为 1。当至少有一个 OSD 位于集群中且未启动并运行时,监控器会警告用户。
  10. PreviewEdit 下的输入字段中,为 monitor 指定一个标题。这是保存监控器所必需的。
  11. 在文本字段中输入警报的描述。

    注意

    文本字段支持指标变量和 Markdown 语法。

  12. 添加警报的接收者。这将向文本字段添加一个电子邮件地址。触发警报时,接收者将收到警报。

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat