Red Hat Training

A Red Hat training course is available for Red Hat Ceph Storage

5.5.3. Prometheus 環境の管理

Prometheus を使用して Ceph ストレージクラスターを監視するには、Prometheus エクスポーターを設定および有効にし、Ceph ストレージクラスターに関するメタデータ情報を収集できるようにします。

前提条件

  • 稼働中の Red Hat Ceph Storage 3.1 クラスター
  • Red Hat Ceph Storage Dashboard のインストール

手順

  1. root ユーザーとして、/etc/prometheus/prometheus.yml ファイルを開いて編集します。

    1. global セクションで、scrape_interval および evaluation_interval オプションを 15 秒に設定します。

      global:
        scrape_interval:     15s
        evaluation_interval: 15s

    2. scrape_configs セクションの下に honor_labels: true オプションを追加し、ceph-mgr ノードごとに targets オプションおよび instance オプションを編集します。

      scrape_configs:
        - job_name: 'node'
          honor_labels: true
          static_configs:
          - targets: [ 'node1.example.com:9100' ]
            labels:
              instance: "node1.example.com"
          - targets: ['node2.example.com:9100']
            labels:
              instance: "node2.example.com"

      注記

      honor_labels オプションを使用すると、Ceph は Ceph Storage クラスターの任意のノードに関連する適切にラベル付けされたデータを出力できます。これにより、Prometheus が上書きせずに Ceph は適切な instance ラベルをエクスポートできます。

    3. 新規ノードを追加するには、以下の形式で targets オプションおよび instance オプションを追加します。

      - targets: [ 'new-node.example.com:9100' ]
        labels:
          instance: "new-node"

      注記

      instance ラベルは、Ceph の OSD メタデータの instance フィールドに表示されるノードの短いホスト名と一致する必要があります。これにより、Ceph 統計をノードの統計と関連付けるのに役立ちます。

  2. 以下の形式で、Ceph ターゲットを /etc/prometheus/ceph_targets.yml ファイルに追加します。

    [
        {
            "targets": [ "cephnode1.example.com:9283" ],
            "labels": {}
        }
    ]

  3. Prometheus モジュールを有効にします。

    # ceph mgr module enable prometheus