5장. Gathering data about your cluster
When opening a support case, it is helpful to provide debugging information about your cluster to Red Hat Support. You can use tools such as must-gather, sosreport, and cluster node journal logs to collect diagnostic data.
When opening a support case, it is helpful to provide debugging information about your cluster to Red Hat Support.
It is recommended to provide:
5.1. About the must-gather tool 링크 복사링크가 클립보드에 복사되었습니다!
The oc adm must-gather CLI command collects the information from your cluster that is most likely needed for debugging issues, including:
- Resource definitions
- Service logs
By default, the oc adm must-gather command uses the default plugin image and writes into ./must-gather.local.
Alternatively, you can collect specific information by running the command with the appropriate arguments as described in the following sections:
To collect data related to one or more specific features, use the
--imageargument with an image, as listed in a following section.For example:
$ oc adm must-gather \ --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.21.6To collect the audit logs, use the
-- /usr/bin/gather_audit_logsargument, as described in a following section.For example:
$ oc adm must-gather -- /usr/bin/gather_audit_logs참고- Audit logs are not collected as part of the default set of information to reduce the size of the files.
-
On a Windows operating system, install the
cwRsyncclient and add to thePATHvariable for use with theoc rsynccommand.
When you run oc adm must-gather, a new pod with a random name is created in a new project on the cluster. The data is collected on that pod and saved in a new directory that starts with must-gather.local in the current working directory.
For example:
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
...
Optionally, you can run the oc adm must-gather command in a specific namespace by using the --run-namespace option.
For example:
$ oc adm must-gather --run-namespace <namespace> \
--image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.21.6
5.1.1. Gathering data about your cluster for Red Hat Support 링크 복사링크가 클립보드에 복사되었습니다!
You can gather debugging information about your cluster by using the oc adm must-gather CLI command.
If you are gathering information to debug a self-managed hosted cluster, see "Gathering information to troubleshoot hosted control planes".
Prerequisites
-
You have access to the cluster as a user with the
cluster-adminrole. -
The OpenShift Container Platform CLI (
oc) is installed.
Procedure
Navigate to the directory where you want to store the
must-gatherdata.참고If your cluster is in a disconnected environment, you must take additional steps. If your mirror registry has a trusted CA, you must first add the trusted CA to the cluster. For all clusters in disconnected environments, you must import the default
must-gatherimage as an image stream.$ oc import-image is/must-gather -n openshiftRun the
oc adm must-gathercommand:$ oc adm must-gather중요If you are in a disconnected environment, use the
--imageflag as part of must-gather and point to the payload image.참고Because this command picks a random control plane node by default, the pod might be scheduled to a control plane node that is in the
NotReadyandSchedulingDisabledstate.If this command fails, for example, if you cannot schedule a pod on your cluster, then use the
oc adm inspectcommand to gather information for particular resources.참고Contact Red Hat Support for the recommended resources to gather.
Create a compressed file from the
must-gatherdirectory that was just created in your working directory. Make sure you provide the date and cluster ID for the unique must-gather data. For more information about how to find the cluster ID, see How to find the cluster-id or name on OpenShift cluster. For example, on a computer that uses a Linux operating system, run the following command:$ tar cvaf must-gather-`date +"%m-%d-%Y-%H-%M-%S"`-<cluster_id>.tar.gz <must_gather_local_dir>where:
<must_gather_local_dir>- Replace with the actual directory name.
- Attach the compressed file to your support case on the the Customer Support page of the Red Hat Customer Portal.