3.4. Elasticsearch ログストアのステータスの表示
OpenShift Elasticsearch Operator のステータスや、数多くの Elasticsearch コンポーネントを表示できます。
3.4.1. Elasticsearch ログストアのステータスの表示
Elasticsearch ログストアのステータスを表示できます。
前提条件
- Red Hat OpenShift Logging Operator と OpenShift Elasticsearch Operator がインストールされている。
手順
次のコマンドを実行して、
openshift-logging
プロジェクトに変更します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc project openshift-logging
$ oc project openshift-logging
ステータスを表示するには、以下を実行します。
次のコマンドを実行して、Elasticsearch ログストアインスタンスの名前を取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get Elasticsearch
$ oc get Elasticsearch
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME AGE elasticsearch 5h9m
NAME AGE elasticsearch 5h9m
次のコマンドを実行して、Elasticsearch ログストアのステータスを取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get Elasticsearch <Elasticsearch-instance> -o yaml
$ oc get Elasticsearch <Elasticsearch-instance> -o yaml
以下に例を示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get Elasticsearch elasticsearch -n openshift-logging -o yaml
$ oc get Elasticsearch elasticsearch -n openshift-logging -o yaml
出力には、以下のような情報が含まれます。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow status: cluster: activePrimaryShards: 30 activeShards: 60 initializingShards: 0 numDataNodes: 3 numNodes: 3 pendingTasks: 0 relocatingShards: 0 status: green unassignedShards: 0 clusterHealth: "" conditions: [] nodes: - deploymentName: elasticsearch-cdm-zjf34ved-1 upgradeStatus: {} - deploymentName: elasticsearch-cdm-zjf34ved-2 upgradeStatus: {} - deploymentName: elasticsearch-cdm-zjf34ved-3 upgradeStatus: {} pods: 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
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
- Elasticsearch ログストアのステータス:
- アクティブなプライマリーシャードの数
- アクティブなシャードの数
- 初期化されるシャードの数
- Elasticsearch ログストアのデータノードの数
- Elasticsearch ログストアのノードの合計数
- 保留中のタスクの数
-
Elasticsearch ログストアのステータス:
green
、red
、yellow
- 未割り当てのシャードの数。
- 3
- ステータス状態 (ある場合)。Elasticsearch ログストアのステータスは、Pod を配置できなかった場合にスケジューラーからの理由を示します。以下の状況に関連したイベントが表示されます。
- Elasticsearch ログストアおよびプロキシーコンテナーの両方をコンテナーが待機している。
- Elasticsearch ログストアとプロキシーコンテナーの両方でコンテナーが終了した。
- Pod がスケジュール対象外である。また、いくつかの問題に関する条件も示されています。詳細は、状態メッセージのサンプル を参照してください。
- 4
- Elasticsearch ログには、
upgradeStatus
のクラスター内のノードが保存されます。 - 5
- クラスター内にある Elasticsearch ログストアのクライアント、データ、およびマスター Pod。
failed
、notReady
、またはready
状態の下にリスト表示されます。
3.4.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-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: {}
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) の Elasticsearch ログストアのノードセレクターがクラスター内のどのノードとも一致しないことを示します。
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
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
次のステータスメッセージは、Elasticsearch ログストア 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:
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
次のステータスメッセージは、Elasticsearch ログストアクラスターに冗長性ポリシーをサポートするのに十分なノードがないことを示します。
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: ""
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
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
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 を削除する必要があります。
3.4.2. ログストアコンポーネントのステータスの表示
数多くのログストアコンポーネントのステータスを表示できます。
- Elasticsearch インデックス
Elasticsearch インデックスのステータスを表示できます。
Elasticsearch Pod の名前を取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get pods --selector component=elasticsearch -o name
$ oc get pods --selector component=elasticsearch -o name
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7
pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7
インデックスのステータスを取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc exec elasticsearch-cdm-4vjor49p-2-6d4d7db474-q2w7z -- indices
$ oc exec elasticsearch-cdm-4vjor49p-2-6d4d7db474-q2w7z -- indices
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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 のステータスを表示できます。
Pod の名前を取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get pods --selector component=elasticsearch -o name
$ oc get pods --selector component=elasticsearch -o name
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7
pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7
Pod のステータスを取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc describe pod elasticsearch-cdm-1godmszn-1-6f8495-vp4lw
$ oc describe pod elasticsearch-cdm-1godmszn-1-6f8495-vp4lw
出力には、以下のようなステータス情報が含まれます。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .... 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>
.... 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 デプロイメント設定
ログストアのデプロイメント設定のステータスを表示できます。
デプロイメント設定の名前を取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get deployment --selector component=elasticsearch -o name
$ oc get deployment --selector component=elasticsearch -o name
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow deployment.extensions/elasticsearch-cdm-1gon-1 deployment.extensions/elasticsearch-cdm-1gon-2 deployment.extensions/elasticsearch-cdm-1gon-3
deployment.extensions/elasticsearch-cdm-1gon-1 deployment.extensions/elasticsearch-cdm-1gon-2 deployment.extensions/elasticsearch-cdm-1gon-3
デプロイメント設定のステータスを取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc describe deployment elasticsearch-cdm-1gon-1
$ oc describe deployment elasticsearch-cdm-1gon-1
出力には、以下のようなステータス情報が含まれます。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .... 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>
.... 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>
- ログストアのレプリカセット
ログストアのレプリカセットのステータスを表示できます。
レプリカセットの名前を取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get replicaSet --selector component=elasticsearch -o name
$ 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
レプリカセットのステータスを取得します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc describe replicaSet elasticsearch-cdm-1gon-1-6f8495
$ oc describe replicaSet elasticsearch-cdm-1gon-1-6f8495
出力には、以下のようなステータス情報が含まれます。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .... 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>
.... 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>
3.4.3. Elasticsearch クラスターのステータス
OpenShift Container Platform Web コンソールのObserveセクションにあるダッシュボードには、Elasticsearch クラスターのステータスが表示されます。
OpenShift Elasticsearch クラスターのステータスを取得するには、OpenShift Container Platform Web コンソールのObserveセクションにあるダッシュボード <cluster_url>/monitoring/dashboards/grafana-dashboard-cluster-logging
にアクセスします。
Elasticsearch ステータスフィールド
eo_elasticsearch_cr_cluster_management_state
Elasticsearch クラスターがマネージドか、マネージド外かを示します。以下に例を示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow eo_elasticsearch_cr_cluster_management_state{state="managed"} 1 eo_elasticsearch_cr_cluster_management_state{state="unmanaged"} 0
eo_elasticsearch_cr_cluster_management_state{state="managed"} 1 eo_elasticsearch_cr_cluster_management_state{state="unmanaged"} 0
eo_elasticsearch_cr_restart_total
Elasticsearch ノードが証明書の再起動、ローリング再起動、またはスケジュールされた再起動など、再起動した回数を示します。以下に例を示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow eo_elasticsearch_cr_restart_total{reason="cert_restart"} 1 eo_elasticsearch_cr_restart_total{reason="rolling_restart"} 1 eo_elasticsearch_cr_restart_total{reason="scheduled_restart"} 3
eo_elasticsearch_cr_restart_total{reason="cert_restart"} 1 eo_elasticsearch_cr_restart_total{reason="rolling_restart"} 1 eo_elasticsearch_cr_restart_total{reason="scheduled_restart"} 3
es_index_namespaces_total
Elasticsearch インデックス namespace の総数を表示します。以下に例を示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Total number of Namespaces. es_index_namespaces_total 5
Total number of Namespaces. es_index_namespaces_total 5
es_index_document_count
各 namespace のレコード数を表示します。以下に例を示します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow es_index_document_count{namespace="namespace_1"} 25 es_index_document_count{namespace="namespace_2"} 10 es_index_document_count{namespace="namespace_3"} 5
es_index_document_count{namespace="namespace_1"} 25 es_index_document_count{namespace="namespace_2"} 10 es_index_document_count{namespace="namespace_3"} 5
"Secret Elasticsearch fields are either missing or empty" メッセージ
Elasticsearch に admin-cert
、admin-key
、logging-es.crt
、または logging-es.key
ファイルがない場合、ダッシュボードには次の例のようなステータスメッセージが表示されます。
message": "Secret \"elasticsearch\" fields are either missing or empty: [admin-cert, admin-key, logging-es.crt, logging-es.key]", "reason": "Missing Required Secrets",
message": "Secret \"elasticsearch\" fields are either missing or empty: [admin-cert, admin-key, logging-es.crt, logging-es.key]",
"reason": "Missing Required Secrets",