第5章 クラスターに関するデータの収集


サポートケースを作成する際、ご使用のクラスターに関するデバッグ情報を Red Hat サポートに提供していただくと Red Hat のサポートに役立ちます。

以下を提供することが推奨されます。

5.1. must-gather ツールについて

oc adm must-gather CLI コマンドは、以下のような問題のデバッグに必要となる可能性のあるクラスターからの情報を収集します。

  • リソース定義
  • サービスログ

デフォルトで、oc adm must-gather コマンドはデフォルトのプラグインイメージを使用し、./must-gather.local に書き込みを行います。

または、以下のセクションで説明されているように、適切な引数を指定してコマンドを実行すると、特定の情報を収集できます。

  • 1 つ以上の特定の機能に関連するデータを収集するには、以下のセクションに示すように、イメージと共に --image 引数を使用します。

    以下に例を示します。

    $ oc adm must-gather \
      --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.18.13
    Copy to Clipboard Toggle word wrap
    • 監査ログを収集するには、以下のセクションで説明されているように -- /usr/bin/gather_audit_logs 引数を使用します。

      以下に例を示します。

      $ oc adm must-gather -- /usr/bin/gather_audit_logs
      Copy to Clipboard Toggle word wrap
      注記
      • ファイルのサイズを小さくするために、監査ログはデフォルトの情報セットの一部として収集されません。
      • Windows オペレーティングシステムでは、oc rsync コマンドで使用するために cwRsync クライアントをインストールし、PATH 変数に追加します。

oc adm must-gather を実行すると、ランダムな名前を持つ新規 Pod がクラスターの新規プロジェクトに作成されます。データはその Pod 上で収集され、現在の作業ディレクトリー内の must-gather.local で始まる新しいディレクトリーに保存されます。

以下に例を示します。

NAMESPACE                      NAME                 READY   STATUS      RESTARTS      AGE
...
openshift-must-gather-5drcj    must-gather-bklx4    2/2     Running     0             72s
openshift-must-gather-5drcj    must-gather-s8sdh    2/2     Running     0             72s
...
Copy to Clipboard Toggle word wrap

任意で、--run-namespace オプションを使用して、特定の namespace で oc adm must-gather コマンドを実行できます。

以下に例を示します。

$ oc adm must-gather --run-namespace <namespace> \
  --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.18.13
Copy to Clipboard Toggle word wrap

5.1.1. Red Hat サポート用のクラスターに関するデータの収集

oc adm must-gather CLI コマンドを使用して、クラスターに関するデバッグ情報を収集できます。

セルフマネージドのホステッドクラスターをデバッグするための情報を収集する場合は、「Hosted Control Plane のトラブルシューティング用の情報収集」を参照してください。

前提条件

  • cluster-admin ロールを持つユーザーとしてクラスターにアクセスできる。
  • OpenShift Container Platform CLI (oc) がインストールされている。

手順

  1. must-gather データを保存するディレクトリーに移動します。

    注記

    クラスターが非接続環境にある場合は、追加の手順を実行する必要があります。ミラーレジストリーに信頼される CA がある場合、まず信頼される CA をクラスターに追加する必要があります。非接続環境のすべてのクラスターに対して、デフォルトの must-gather イメージをイメージストリームとしてインポートする必要があります。

    $ oc import-image is/must-gather -n openshift
    Copy to Clipboard Toggle word wrap
  2. oc adm must-gather コマンドを実行します。

    $ oc adm must-gather
    Copy to Clipboard Toggle word wrap
    重要

    非接続環境を使用している場合には、must-gather の一部として --image フラグを使用し、ペイロードイメージを参照します。

    注記

    このコマンドは、デフォルトでランダムなコントロールプレーンノードを選択するため、Pod は NotReady および SchedulingDisabled 状態のコントロールプレーンノードにスケジュールされる場合があります。

    1. このコマンドが失敗する場合 (クラスターで Pod をスケジュールできない場合など)、oc adm inspect コマンドを使用して、特定リソースに関する情報を収集します。

      注記

      収集する推奨リソースは、Red Hat サポートにお問い合わせください。

  3. 作業ディレクトリーに作成された must-gather ディレクトリーから圧縮ファイルを作成します。固有の must-gather データの日付とクラスター ID を必ず提供してください。クラスター ID を確認する方法の詳細は、How to find the cluster-id or name on OpenShift cluster を参照してください。たとえば、Linux オペレーティングシステムを使用するコンピューターで以下のコマンドを実行します。

    $ tar cvaf must-gather-`date +"%m-%d-%Y-%H-%M-%S"`-<cluster_id>.tar.gz <must_gather_local_dir> 
    1
    Copy to Clipboard Toggle word wrap
    1
    <must_gather_local_dir> は、実際のディレクトリー名に置き換えます。
  4. Red Hat カスタマーポータルの カスタマーサポート ページ で、圧縮ファイルをサポートケースに添付します。

5.1.2. must-gather フラグ

次の表にリストされているフラグは、oc adm must-gather コマンドで使用できます。

Expand
表5.1 oc adm must-gather の OpenShift Container Platform フラグ
フラグコマンドの例説明

--all-images

oc adm must-gather --all-images=false

クラスター上の、operators.openshift.io/must-gather-image でアノテーションが付けられたすべての Operator のデフォルトイメージを使用して、must-gather データを収集します。

--dest-dir

oc adm must-gather --dest-dir='<directory_name>'

収集されたデータが書き込まれるローカルマシン上の特定のディレクトリーを設定します。

--host-network

oc adm must-gather --host-network=false

must-gather Pod を hostNetwork: true として実行します。特定のコマンドとイメージでホストレベルのデータをキャプチャーする必要がある場合に関連します。

--image

oc adm must-gather --image=[<plugin_image>]

実行する must-gather プラグインイメージを指定します。指定されていない場合は、OpenShift Container Platform のデフォルトの must-gather イメージが使用されます。

--image-stream

oc adm must-gather --image-stream=[<image_stream>]

実行する must-gather プラグインイメージを含む namespace または name:tag 値を使用して、`<image_stream>` を指定します。

--node-name

oc adm must-gather --node-name='<node>'

使用する特定のノードを設定します。指定しない場合は、デフォルトでランダムマスターが使用されます。

--node-selector

oc adm must-gather --node-selector='<node_selector_name>'

使用する特定のノードセレクターを設定します。クラスターノードのセットで同時にデータをキャプチャーする必要があるコマンドとイメージを指定する場合にのみ関連します。

--run-namespace

oc adm must-gather --run-namespace='<namespace>'

must-gather Pod を実行する既存の特権 namespace。指定しない場合は、一時的な namespace が生成されます。

--since

oc adm must-gather --since=<time>

指定された期間よりも新しいログのみを返します。デフォルトはすべてのログです。プラグインが推奨されますが、このサポートには必要はありません。since-time または since を 1 つだけ使用できます。

--since-time

oc adm must-gather --since-time='<date_and_time>'

(RFC3339) 形式で表現された特定の日時以降のログのみを返します。デフォルトはすべてのログです。プラグインが推奨されますが、このサポートには必要はありません。since-time または since を 1 つだけ使用できます。

--source-dir

oc adm must-gather --source-dir='/<directory_name>/'

収集したデータをコピーする Pod 上の特定のディレクトリーを設定します。

--timeout

oc adm must-gather --timeout='<time>'

タイムアウトする前にデータを収集する時間の長さ。秒、分、時間で表されます (例: 3s、5m、2h)。指定する時間は 0 より大きい必要があります。指定されていない場合はデフォルトで 10 分になります。

--volume-percentage

oc adm must-gather --volume-percentage=<percent>

must-gather に使用できる Pod の割り当てボリュームの最大パーセンテージを指定します。この制限を超えると、must-gather は収集を停止しますが、収集されたデータはコピーし続けます。指定されていない場合はデフォルトで 30% になります。

5.1.3. 特定の機能に関するデータ収集

oc adm must-gather CLI コマンドを --image または --image-stream 引数と共に使用して、特定に機能に関するデバッグ情報を収集できます。must-gather ツールは複数のイメージをサポートするため、単一のコマンドを実行して複数の機能に関するデータを収集できます。

Expand
表5.2 サポート対象の must-gather イメージ
イメージ目的

registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.18.13

OpenShift Virtualization のデータ収集。

registry.redhat.io/openshift-serverless-1/svls-must-gather-rhel8

OpenShift Serverless のデータ収集。

registry.redhat.io/openshift-service-mesh/istio-must-gather-rhel8:<installed_version_service_mesh>

Red Hat OpenShift Service Mesh のデータ収集。

registry.redhat.io/multicluster-engine/must-gather-rhel8

Hosted Control Plane のデータ収集。

registry.redhat.io/rhmtc/openshift-migration-must-gather-rhel8:v<installed_version_migration_toolkit>

Migration Toolkit for Containers のデータ収集。

registry.redhat.io/odf4/odf-must-gather-rhel9:v<installed_version_ODF>

Red Hat OpenShift Data Foundation のデータ収集。

registry.redhat.io/openshift-logging/cluster-logging-rhel9-operator:v<installed_version_logging>

ロギング用のデータ収集。

quay.io/netobserv/must-gather

Network Observability Operator のデータ収集。

registry.redhat.io/openshift4/ose-local-storage-mustgather-rhel9:v<installed_version_LSO>

ローカルストレージ Operator のデータ収集。

registry.redhat.io/openshift-sandboxed-containers/osc-must-gather-rhel8:v<installed_version_sandboxed_containers>

OpenShift サンドボックスコンテナーのデータ収集。

registry.redhat.io/workload-availability/node-healthcheck-must-gather-rhel8:v<installed_version_NHC>

Red Hat Workload Availability Operator のデータ収集。これには、Self Node Remediation (SNR) Operator、Fence Agents Remediation (FAR) Operator、Machine Deletion Remediation (MDR) Operator、Node Health Check (NHC) Operator、および Node Maintenance Operator (NMO) が含まれます。

NHC Operator バージョンが 0.9.0 より前 の場合は、このイメージを使用します。

詳細は、修復、フェンシング、およびメンテナンス (Workload Availability for Red Hat OpenShift ドキュメント) の各 Operator の「データの収集」セクションを参照してください。

registry.redhat.io/workload-availability/node-healthcheck-must-gather-rhel9:v<installed_version_NHC>

Red Hat Workload Availability Operator のデータ収集。これには、Self Node Remediation (SNR) Operator、Fence Agents Remediation (FAR) Operator、Machine Deletion Remediation (MDR) Operator、Node Health Check (NHC) Operator、および Node Maintenance Operator (NMO) が含まれます。

NHC Operator バージョンが 0.9.0 以降 の場合は、このイメージを使用します。

詳細は、修復、フェンシング、およびメンテナンス (Workload Availability for Red Hat OpenShift ドキュメント) の各 Operator の「データの収集」セクションを参照してください。

registry.redhat.io/numaresources/numaresources-must-gather-rhel9:v<installed-version-nro>

NUMA Resources Operator (NRO) のデータ収集。

registry.redhat.io/openshift4/ptp-must-gather-rhel8:v<installed-version-ptp>

PTP Operator のデータ収集。

registry.redhat.io/openshift-gitops-1/must-gather-rhel8:v<installed_version_GitOps>

Red Hat OpenShift GitOps のデータ収集。

registry.redhat.io/openshift4/ose-secrets-store-csi-mustgather-rhel9:v<installed_version_secret_store>

Secrets Store CSI Driver Operator のデータ収集。

registry.redhat.io/lvms4/lvms-must-gather-rhel9:v<installed_version_LVMS>

LVM Operator のデータ収集。

registry.redhat.io/compliance/openshift-compliance-must-gather-rhel8:<digest-version>

Compliance Operator のデータ収集。

注記

OpenShift Container Platform コンポーネントのイメージの最新バージョンを確認するには、Red Hat カスタマーポータルの OpenShift Operator ライフサイクル Web ページを参照してください。

前提条件

  • cluster-admin ロールを持つユーザーとしてクラスターにアクセスできる。
  • OpenShift Container Platform CLI (oc) がインストールされている。

手順

  1. must-gather データを保存するディレクトリーに移動します。
  2. oc adm must-gather コマンドを 1 つまたは複数の --image または --image-stream 引数と共に実行します。

    注記
    • 特定の機能データに加えてデフォルトの must-gather データを収集するには、--image-stream=openshift/must-gather 引数を追加します。
    • Custom Metrics Autoscaler に関するデータの収集は、以下の関連情報セクションを参照してください。

    たとえば、以下のコマンドは、デフォルトのクラスターデータと OpenShift Virtualization に固有の情報の両方を収集します。

    $ oc adm must-gather \
      --image-stream=openshift/must-gather \ 
    1
    
      --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.18.13 
    2
    Copy to Clipboard Toggle word wrap
    1
    デフォルトの OpenShift Container Platform must-gather イメージ
    2
    OpenShift Virtualization の must-gather イメージ

    must-gather ツールを追加の引数と共に使用し、OpenShift Logging およびクラスター内の Red Hat OpenShift Logging Operator に関連するデータを収集できます。OpenShift Logging の場合、以下のコマンドを実行します。

    $ oc adm must-gather --image=$(oc -n openshift-logging get deployment.apps/cluster-logging-operator \
      -o jsonpath='{.spec.template.spec.containers[?(@.name == "cluster-logging-operator")].image}')
    Copy to Clipboard Toggle word wrap

    例5.1 OpenShift Logging の must-gather の出力例

    ├── cluster-logging
    │  ├── clo
    │  │  ├── cluster-logging-operator-74dd5994f-6ttgt
    │  │  ├── clusterlogforwarder_cr
    │  │  ├── cr
    │  │  ├── csv
    │  │  ├── deployment
    │  │  └── logforwarding_cr
    │  ├── collector
    │  │  ├── fluentd-2tr64
    │  ├── eo
    │  │  ├── csv
    │  │  ├── deployment
    │  │  └── elasticsearch-operator-7dc7d97b9d-jb4r4
    │  ├── es
    │  │  ├── cluster-elasticsearch
    │  │  │  ├── aliases
    │  │  │  ├── health
    │  │  │  ├── indices
    │  │  │  ├── latest_documents.json
    │  │  │  ├── nodes
    │  │  │  ├── nodes_stats.json
    │  │  │  └── thread_pool
    │  │  ├── cr
    │  │  ├── elasticsearch-cdm-lp8l38m0-1-794d6dd989-4jxms
    │  │  └── logs
    │  │     ├── elasticsearch-cdm-lp8l38m0-1-794d6dd989-4jxms
    │  ├── install
    │  │  ├── co_logs
    │  │  ├── install_plan
    │  │  ├── olmo_logs
    │  │  └── subscription
    │  └── kibana
    │     ├── cr
    │     ├── kibana-9d69668d4-2rkvz
    ├── cluster-scoped-resources
    │  └── core
    │     ├── nodes
    │     │  ├── ip-10-0-146-180.eu-west-1.compute.internal.yaml
    │     └── persistentvolumes
    │        ├── pvc-0a8d65d9-54aa-4c44-9ecc-33d9381e41c1.yaml
    ├── event-filter.html
    ├── gather-debug.log
    └── namespaces
       ├── openshift-logging
       │  ├── apps
       │  │  ├── daemonsets.yaml
       │  │  ├── deployments.yaml
       │  │  ├── replicasets.yaml
       │  │  └── statefulsets.yaml
       │  ├── batch
       │  │  ├── cronjobs.yaml
       │  │  └── jobs.yaml
       │  ├── core
       │  │  ├── configmaps.yaml
       │  │  ├── endpoints.yaml
       │  │  ├── events
       │  │  │  ├── elasticsearch-im-app-1596020400-gm6nl.1626341a296c16a1.yaml
       │  │  │  ├── elasticsearch-im-audit-1596020400-9l9n4.1626341a2af81bbd.yaml
       │  │  │  ├── elasticsearch-im-infra-1596020400-v98tk.1626341a2d821069.yaml
       │  │  │  ├── elasticsearch-im-app-1596020400-cc5vc.1626341a3019b238.yaml
       │  │  │  ├── elasticsearch-im-audit-1596020400-s8d5s.1626341a31f7b315.yaml
       │  │  │  ├── elasticsearch-im-infra-1596020400-7mgv8.1626341a35ea59ed.yaml
       │  │  ├── events.yaml
       │  │  ├── persistentvolumeclaims.yaml
       │  │  ├── pods.yaml
       │  │  ├── replicationcontrollers.yaml
       │  │  ├── secrets.yaml
       │  │  └── services.yaml
       │  ├── openshift-logging.yaml
       │  ├── pods
       │  │  ├── cluster-logging-operator-74dd5994f-6ttgt
       │  │  │  ├── cluster-logging-operator
       │  │  │  │  └── cluster-logging-operator
       │  │  │  │     └── logs
       │  │  │  │        ├── current.log
       │  │  │  │        ├── previous.insecure.log
       │  │  │  │        └── previous.log
       │  │  │  └── cluster-logging-operator-74dd5994f-6ttgt.yaml
       │  │  ├── cluster-logging-operator-registry-6df49d7d4-mxxff
       │  │  │  ├── cluster-logging-operator-registry
       │  │  │  │  └── cluster-logging-operator-registry
       │  │  │  │     └── logs
       │  │  │  │        ├── current.log
       │  │  │  │        ├── previous.insecure.log
       │  │  │  │        └── previous.log
       │  │  │  ├── cluster-logging-operator-registry-6df49d7d4-mxxff.yaml
       │  │  │  └── mutate-csv-and-generate-sqlite-db
       │  │  │     └── mutate-csv-and-generate-sqlite-db
       │  │  │        └── logs
       │  │  │           ├── current.log
       │  │  │           ├── previous.insecure.log
       │  │  │           └── previous.log
       │  │  ├── elasticsearch-cdm-lp8l38m0-1-794d6dd989-4jxms
       │  │  ├── elasticsearch-im-app-1596030300-bpgcx
       │  │  │  ├── elasticsearch-im-app-1596030300-bpgcx.yaml
       │  │  │  └── indexmanagement
       │  │  │     └── indexmanagement
       │  │  │        └── logs
       │  │  │           ├── current.log
       │  │  │           ├── previous.insecure.log
       │  │  │           └── previous.log
       │  │  ├── fluentd-2tr64
       │  │  │  ├── fluentd
       │  │  │  │  └── fluentd
       │  │  │  │     └── logs
       │  │  │  │        ├── current.log
       │  │  │  │        ├── previous.insecure.log
       │  │  │  │        └── previous.log
       │  │  │  ├── fluentd-2tr64.yaml
       │  │  │  └── fluentd-init
       │  │  │     └── fluentd-init
       │  │  │        └── logs
       │  │  │           ├── current.log
       │  │  │           ├── previous.insecure.log
       │  │  │           └── previous.log
       │  │  ├── kibana-9d69668d4-2rkvz
       │  │  │  ├── kibana
       │  │  │  │  └── kibana
       │  │  │  │     └── logs
       │  │  │  │        ├── current.log
       │  │  │  │        ├── previous.insecure.log
       │  │  │  │        └── previous.log
       │  │  │  ├── kibana-9d69668d4-2rkvz.yaml
       │  │  │  └── kibana-proxy
       │  │  │     └── kibana-proxy
       │  │  │        └── logs
       │  │  │           ├── current.log
       │  │  │           ├── previous.insecure.log
       │  │  │           └── previous.log
       │  └── route.openshift.io
       │     └── routes.yaml
       └── openshift-operators-redhat
          ├── ...
    Copy to Clipboard Toggle word wrap
  3. oc adm must-gather コマンドを 1 つまたは複数の --image または --image-stream 引数と共に実行します。たとえば、以下のコマンドは、デフォルトのクラスターデータと KubeVirt に固有の情報の両方を収集します。

    $ oc adm must-gather \
     --image-stream=openshift/must-gather \ 
    1
    
     --image=quay.io/kubevirt/must-gather 
    2
    Copy to Clipboard Toggle word wrap
    1
    デフォルトの OpenShift Container Platform must-gather イメージ
    2
    KubeVirt の must-gather イメージ
  4. 作業ディレクトリーに作成された must-gather ディレクトリーから圧縮ファイルを作成します。固有の must-gather データの日付とクラスター ID を必ず提供してください。クラスター ID を確認する方法の詳細は、How to find the cluster-id or name on OpenShift cluster を参照してください。たとえば、Linux オペレーティングシステムを使用するコンピューターで以下のコマンドを実行します。

    $ tar cvaf must-gather-`date +"%m-%d-%Y-%H-%M-%S"`-<cluster_id>.tar.gz <must_gather_local_dir> 
    1
    Copy to Clipboard Toggle word wrap
    1
    <must_gather_local_dir> は、実際のディレクトリー名に置き換えます。
  5. Red Hat カスタマーポータルの カスタマーサポート ページ で、圧縮ファイルをサポートケースに添付します。

5.1.4. ネットワークログの収集

クラスター内のすべてのノードでネットワークログを収集できます。

手順

  1. -- gather_network_logs を指定して oc adm must-gather コマンドを実行します。

    $ oc adm must-gather -- gather_network_logs
    Copy to Clipboard Toggle word wrap
    注記

    デフォルトでは、must-gather ツールはクラスター内のすべてのノードから OVN nbdb および sbdb データベースを収集します。-- gather_network_logs オプションを追加すると、OVN nbdb データベースの OVN-Kubernetes トランザクションを含むログが追加されます。

  2. 作業ディレクトリーに作成された must-gather ディレクトリーから圧縮ファイルを作成します。固有の must-gather データの日付とクラスター ID を必ず提供してください。クラスター ID を確認する方法の詳細は、How to find the cluster-id or name on OpenShift cluster を参照してください。たとえば、Linux オペレーティングシステムを使用するコンピューターで以下のコマンドを実行します。

    $ tar cvaf must-gather-`date +"%m-%d-%Y-%H-%M-%S"`-<cluster_id>.tar.gz <must_gather_local_dir>
    1
    Copy to Clipboard Toggle word wrap
    1
    <must_gather_local_dir> は、実際のディレクトリー名に置き換えます。
  3. Red Hat カスタマーポータルの カスタマーサポート ページ で、圧縮ファイルをサポートケースに添付します。

5.1.5. must-gather ストレージ制限の変更

oc adm must-gather コマンドを使用してデータを収集する場合、情報のデフォルトの最大ストレージは、コンテナーのストレージ容量の 30% です。30% の制限に達すると、コンテナーが強制終了し、収集プロセスが停止します。すでに収集された情報は、ローカルストレージにダウンロードされます。must-gather コマンドを再度実行するには、ストレージ容量がより大きなコンテナーを使用するか、最大ボリュームの割合を調整する必要があります。

コンテナーがストレージ制限に達すると、次の例のようなエラーメッセージが生成されます。

出力例

Disk usage exceeds the volume percentage of 30% for mounted directory. Exiting...
Copy to Clipboard Toggle word wrap

前提条件

  • cluster-admin ロールを持つユーザーとしてクラスターにアクセスできる。
  • OpenShift CLI (oc) がインストールされている。

手順

  • volume-percentage フラグを指定して oc adm must-gather コマンドを実行します。新しい値として 100 を超える値を指定することはできません。

    $ oc adm must-gather --volume-percentage <storage_percentage>
    Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat