12.2. ログストアのステータスの表示

OpenShift Elasticsearch Operator のステータスや、数多くの Elasticsearch コンポーネントを表示できます。

12.2.1. ログストアのステータスの表示

ログストアのステータスを表示することができます。

前提条件

  • OpenShift Logging および Elasticsearch がインストールされている。

手順

  1. openshift-logging プロジェクトに切り替えます。

    $ oc project openshift-logging
  2. ステータスを表示するには、以下を実行します。

    1. ログストアインスタンスの名前を取得します。

      $ oc get Elasticsearch

      出力例

      NAME            AGE
      elasticsearch   5h9m

    2. ログストアのステータスを取得します。

      $ oc get Elasticsearch <Elasticsearch-instance> -o yaml

      以下に例を示します。

      $ oc get Elasticsearch elasticsearch -n openshift-logging -o yaml

      出力には、以下のような情報が含まれます。

      出力例

      status: 1
        cluster: 2
          activePrimaryShards: 30
          activeShards: 60
          initializingShards: 0
          numDataNodes: 3
          numNodes: 3
          pendingTasks: 0
          relocatingShards: 0
          status: green
          unassignedShards: 0
        clusterHealth: ""
        conditions: [] 3
        nodes: 4
        - deploymentName: elasticsearch-cdm-zjf34ved-1
          upgradeStatus: {}
        - deploymentName: elasticsearch-cdm-zjf34ved-2
          upgradeStatus: {}
        - deploymentName: elasticsearch-cdm-zjf34ved-3
          upgradeStatus: {}
        pods: 5
          client:
            failed: []
            notReady: []
            ready:
            - elasticsearch-cdm-zjf34ved-1-6d7fbf844f-sn422
            - elasticsearch-cdm-zjf34ved-2-dfbd988bc-qkzjz
            - elasticsearch-cdm-zjf34ved-3-c8f566f7c-t7zkt
          data:
            failed: []
            notReady: []
            ready:
            - elasticsearch-cdm-zjf34ved-1-6d7fbf844f-sn422
            - elasticsearch-cdm-zjf34ved-2-dfbd988bc-qkzjz
            - elasticsearch-cdm-zjf34ved-3-c8f566f7c-t7zkt
          master:
            failed: []
            notReady: []
            ready:
            - elasticsearch-cdm-zjf34ved-1-6d7fbf844f-sn422
            - elasticsearch-cdm-zjf34ved-2-dfbd988bc-qkzjz
            - elasticsearch-cdm-zjf34ved-3-c8f566f7c-t7zkt
        shardAllocationEnabled: all

      1
      出力の status スタンザに、クラスターステータスのフィールドが表示されます。
      2
      ログストアのステータス:
      • アクティブなプライマリーシャードの数
      • アクティブなシャードの数
      • 初期化されるシャードの数
      • ログストアデータノードの数。
      • ログストアノードの合計数。
      • 保留中のタスクの数。
      • ログストアのステータス: greenredyellow
      • 未割り当てのシャードの数。
      3
      ステータス状態 (ある場合)。ログストアのステータスは、Pod が配置されていない場合にスケジューラーからの理由を示します。以下の状況に関連したイベントが表示されます。
      • ログストアおよびプロキシーコンテナーの両方についてコンテナーが待機中。
      • ログストアおよびプロキシーコンテナーの両方についてコンテナーが終了している。
      • Pod がスケジュール対象外である。さらに多数の問題についての状態が表示されます。詳細は、状態メッセージのサンプル を参照してください。
      4
      upgradeStatus のあるクラスター内のログストアノード。
      5
      'failed`、notReady または ready 状態の下に一覧表示された、クラスター内のログストアクライアント、データ、およびマスター Pod。

12.2.1.1. 状態メッセージ (condition message) のサンプル

以下は、Elasticsearch インスタンスの Status セクションからの一部の状態メッセージの例になります。

以下のステータスメッセージは、ノードが設定された低基準値を超えており、シャードがこのノードに割り当てられないことを示します。

status:
  nodes:
  - conditions:
    - lastTransitionTime: 2019-03-15T15:57:22Z
      message: Disk storage usage for node is 27.5gb (36.74%). Shards will be not
        be allocated on this node.
      reason: Disk Watermark Low
      status: "True"
      type: NodeStorage
    deploymentName: example-elasticsearch-cdm-0-1
    upgradeStatus: {}

以下のステータスメッセージは、ノードが設定された高基準値を超えており、シャードが他のノードに移動させられることを示します。

status:
  nodes:
  - conditions:
    - lastTransitionTime: 2019-03-15T16:04:45Z
      message: Disk storage usage for node is 27.5gb (36.74%). Shards will be relocated
        from this node.
      reason: Disk Watermark High
      status: "True"
      type: NodeStorage
    deploymentName: example-elasticsearch-cdm-0-1
    upgradeStatus: {}

以下のステータスメッセージは、CR のログストアノードセレクターがクラスターのいずれのノードにも一致しないことを示します。

status:
    nodes:
    - conditions:
      - lastTransitionTime: 2019-04-10T02:26:24Z
        message: '0/8 nodes are available: 8 node(s) didn''t match node selector.'
        reason: Unschedulable
        status: "True"
        type: Unschedulable

以下のステータスメッセージは、ログストア CR が存在しない 永続ボリューム要求 (PVC) を使用することを示します。

status:
   nodes:
   - conditions:
     - last Transition Time:  2019-04-10T05:55:51Z
       message:               pod has unbound immediate PersistentVolumeClaims (repeated 5 times)
       reason:                Unschedulable
       status:                True
       type:                  Unschedulable

以下のステータスメッセージは、ログストアクラスターには冗長性ポリシーをサポートするための十分なノードがないことを示します。

status:
  clusterHealth: ""
  conditions:
  - lastTransitionTime: 2019-04-17T20:01:31Z
    message: Wrong RedundancyPolicy selected. Choose different RedundancyPolicy or
      add more nodes with data roles
    reason: Invalid Settings
    status: "True"
    type: InvalidRedundancy

このステータスメッセージは、クラスター内のコントロールプレーンノード (別称マスターノード) の数が多過ぎることを示します。

status:
  clusterHealth: green
  conditions:
    - lastTransitionTime: '2019-04-17T20:12:34Z'
      message: >-
        Invalid master nodes count. Please ensure there are no more than 3 total
        nodes with master roles
      reason: Invalid Settings
      status: 'True'
      type: InvalidMasters

以下のステータスメッセージは、加えようとした変更が Elasticsearch ストレージでサポートされないことを示します。

以下に例を示します。

status:
  clusterHealth: green
  conditions:
    - lastTransitionTime: "2021-05-07T01:05:13Z"
      message: Changing the storage structure for a custom resource is not supported
      reason: StorageStructureChangeIgnored
      status: 'True'
      type: StorageStructureChangeIgnored

reason および type フィールドは、サポート対象外の変更のタイプを指定します。

StorageClassNameChangeIgnored
ストレージクラス名の変更がサポートされていません。
StorageSizeChangeIgnored
ストレージサイズの変更がサポートされていません。
StorageStructureChangeIgnored

一時ストレージと永続ストレージ構造間での変更がサポートされていません。

重要

ClusterLogging カスタムリソース (CR) を一時ストレージから永続ストレージに切り替えるように設定する場合に、OpenShift Elasticsearch Operator は永続ボリューム要求 (PVC) を作成しますが、永続ボリューム (PV) は作成されません。StorageStructureChangeIgnored ステータスを削除するには、ClusterLogging CR への変更を元に戻し、PVC を削除する必要があります。

12.2.2. ログストアコンポーネントのステータスの表示

数多くのログストアコンポーネントのステータスを表示することができます。

Elasticsearch インデックス

Elasticsearch インデックスのステータスを表示することができます。

  1. Elasticsearch Pod の名前を取得します。

    $ oc get pods --selector component=elasticsearch -o name

    出力例

    pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw
    pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n
    pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7

  2. インデックスのステータスを取得します。

    $ oc exec elasticsearch-cdm-4vjor49p-2-6d4d7db474-q2w7z -- indices

    出力例

    Defaulting container name to elasticsearch.
    Use 'oc describe pod/elasticsearch-cdm-4vjor49p-2-6d4d7db474-q2w7z -n openshift-logging' to see all of the containers in this pod.
    
    green  open   infra-000002                                                     S4QANnf1QP6NgCegfnrnbQ   3   1     119926            0        157             78
    green  open   audit-000001                                                     8_EQx77iQCSTzFOXtxRqFw   3   1          0            0          0              0
    green  open   .security                                                        iDjscH7aSUGhIdq0LheLBQ   1   1          5            0          0              0
    green  open   .kibana_-377444158_kubeadmin                                     yBywZ9GfSrKebz5gWBZbjw   3   1          1            0          0              0
    green  open   infra-000001                                                     z6Dpe__ORgiopEpW6Yl44A   3   1     871000            0        874            436
    green  open   app-000001                                                       hIrazQCeSISewG3c2VIvsQ   3   1       2453            0          3              1
    green  open   .kibana_1                                                        JCitcBMSQxKOvIq6iQW6wg   1   1          0            0          0              0
    green  open   .kibana_-1595131456_user1                                        gIYFIEGRRe-ka0W3okS-mQ   3   1          1            0          0              0

ログストア Pod

ログストアをホストする Pod のステータスを表示することができます。

  1. Pod の名前を取得します。

    $ oc get pods --selector component=elasticsearch -o name

    出力例

    pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw
    pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n
    pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7

  2. Pod のステータスを取得します。

    $ oc describe pod elasticsearch-cdm-1godmszn-1-6f8495-vp4lw

    出力には、以下のようなステータス情報が含まれます。

    出力例

    ....
    Status:             Running
    
    ....
    
    Containers:
      elasticsearch:
        Container ID:   cri-o://b7d44e0a9ea486e27f47763f5bb4c39dfd2
        State:          Running
          Started:      Mon, 08 Jun 2020 10:17:56 -0400
        Ready:          True
        Restart Count:  0
        Readiness:  exec [/usr/share/elasticsearch/probe/readiness.sh] delay=10s timeout=30s period=5s #success=1 #failure=3
    
    ....
    
      proxy:
        Container ID:  cri-o://3f77032abaddbb1652c116278652908dc01860320b8a4e741d06894b2f8f9aa1
        State:          Running
          Started:      Mon, 08 Jun 2020 10:18:38 -0400
        Ready:          True
        Restart Count:  0
    
    ....
    
    Conditions:
      Type              Status
      Initialized       True
      Ready             True
      ContainersReady   True
      PodScheduled      True
    
    ....
    
    Events:          <none>

ログストレージ Pod デプロイメント設定

ログストアのデプロイメント設定のステータスを表示することができます。

  1. デプロイメント設定の名前を取得します。

    $ oc get deployment --selector component=elasticsearch -o name

    出力例

    deployment.extensions/elasticsearch-cdm-1gon-1
    deployment.extensions/elasticsearch-cdm-1gon-2
    deployment.extensions/elasticsearch-cdm-1gon-3

  2. デプロイメント設定のステータスを取得します。

    $ oc describe deployment elasticsearch-cdm-1gon-1

    出力には、以下のようなステータス情報が含まれます。

    出力例

    ....
      Containers:
       elasticsearch:
        Image:      registry.redhat.io/openshift-logging/elasticsearch6-rhel8
        Readiness:  exec [/usr/share/elasticsearch/probe/readiness.sh] delay=10s timeout=30s period=5s #success=1 #failure=3
    
    ....
    
    Conditions:
      Type           Status   Reason
      ----           ------   ------
      Progressing    Unknown  DeploymentPaused
      Available      True     MinimumReplicasAvailable
    
    ....
    
    Events:          <none>

ログストアのレプリカセット

ログストアのレプリカセットのステータスを表示することができます。

  1. レプリカセットの名前を取得します。

    $ oc get replicaSet --selector component=elasticsearch -o name
    
    replicaset.extensions/elasticsearch-cdm-1gon-1-6f8495
    replicaset.extensions/elasticsearch-cdm-1gon-2-5769cf
    replicaset.extensions/elasticsearch-cdm-1gon-3-f66f7d
  2. レプリカセットのステータスを取得します。

    $ oc describe replicaSet elasticsearch-cdm-1gon-1-6f8495

    出力には、以下のようなステータス情報が含まれます。

    出力例

    ....
      Containers:
       elasticsearch:
        Image:      registry.redhat.io/openshift-logging/elasticsearch6-rhel8@sha256:4265742c7cdd85359140e2d7d703e4311b6497eec7676957f455d6908e7b1c25
        Readiness:  exec [/usr/share/elasticsearch/probe/readiness.sh] delay=10s timeout=30s period=5s #success=1 #failure=3
    
    ....
    
    Events:          <none>