OpenShift 4 之进入到集群节点内执行sosreport收集故障信息

59 篇文章 2 订阅
  1. 先获得OpenShift的节点列表。
$ oc get node
NAME                 STATUS   ROLES           AGE   VERSION
crc-2n9vw-master-0   Ready    master,worker   14d   v1.14.6+6ac6aa4b0
  1. 执行命令创建debug容器并进入,在出现“sh-4.2#”提示符后说明已经进入其内部。
$ oc debug node/crc-2n9vw-master-0
Starting pod/crc-2n9vw-master-0-debug ...
To use host binaries, run `chroot /host`
Pod IP: 172.17.0.8
If you don't see a command prompt, try pressing enter.
sh-4.2\#
  1. (可选)可以在一个新的Terminal窗口可以查到这个名为crc-2n9vw-master-0-debug的Pod。
$ oc get pod
NAME                       READY   STATUS    RESTARTS   AGE
crc-2n9vw-master-0-debug   1/1     Running   0          19s
  1. (可选)可以看到在(2)中OpenShift使用了一个名为crc-2n9vw-master-0-debug的Pod实现debug。我们也可通过以下方式进入该debug容器。
$ oc rsh crc-2n9vw-master-0-debug
  1. 确认无法执行以下命令
sh-4.4\# hostname
sh-4.4\# ip ad
  1. 在进入debug容器后执行,查看系统版本。
sh-4.4\# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)
  1. 执行命令切换根目录,然后查看系统版本。
sh-4.4\# chroot /host
sh-4.4\# cat /etc/redhat-release
Red Hat Enterprise Linux CoreOS release 4.2
  1. 确认现在可以执行以下命令,并且hostname就是“crc-2n9vw-master-0”。
sh-4.4\# hostname
sh-4.4\# ip ad
  1. 执行toolbox命令,安装并进入support-tools容器。
sh-4.4\# toolbox
Trying to pull registry.redhat.io/rhel8/support-tools...Getting image source signatures
Copying blob 386ed6db273d done
Copying blob 340ff6d7f58c done
Copying blob 0e8ea260d026 done
Copying config f7f58f0249 done
Writing manifest to image destination
Storing signatures
f7f58f0249a912ce583820744dd17f11fbedae80c7001dc0602a77a3f66d15fc
Spawning a container 'toolbox-' with image 'registry.redhat.io/rhel8/support-tools'
Detected RUN label in the container image. Using that as the default...
command: podman run -it --name toolbox- --privileged --ipc=host --net=host --pid=host -e HOST=/host -e NAME=toolbox- -e IMAGE=registry.redhat.io/rhel8/support-tools:latest -v /run:/run -v/var/log:/var/log -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -v /:/host registry.redhat.io/rhel8/support-tools:latest
  1. 执行sosreport生成报告。
[root@crc-2n9vw-master-0 /]\# sosreport

sosreport (version 3.7)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

An archive containing the collected information will be generated in
/host/var/tmp/sos.vu50xuiw and may be provided to a Red Hat support
representative.

Any information provided to Red Hat will be treated in accordance with
the published support policies at:

  https://access.redhat.com/support/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.

Press ENTER to continue, or CTRL-C to quit.

Please enter the case id that you are generating this report for []:

 Setting up archive ...
 Setting up plugins ...
[plugin:kvm] debugfs not mounted and mount attempt failed
 Running plugins. Please wait ...

  Starting 74/83 system          [Running: networking runc selinux system]                [plugin:system] _copy_dir: Too many levels of symbolic links copying '/host/proc/sys/fs'
  Finishing plugins              [Running: systemd]
  Finished running plugins
Creating compressed archive...

Your sosreport has been generated and saved in:
  /host/var/tmp/sosreport-crc-2n9vw-master-0-2019-12-07-vcjlvrn.tar.xz

The checksum is: f3e7345e8ac95c54dbdd9dd95a102345

Please send this file to your support representative.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值