1.4. 同时在多个系统中生成和收集 sos 报告
您可以使用 sos 实用程序在多个系统上触发 sos 报告 命令。等待报告终止并收集所有生成的报告。
先决条件
- 您知道 要运行的 机器类型或 节点列表。
-
您已在所有系统上安装
sos软件包。 -
您拥有所有系统中
root帐户的ssh密钥,或者您可以通过--password选项提供 root 密码。
流程
运行
sos collect命令并按照屏幕的说明进行操作。注意默认情况下,
s会收集尝试识别其 运行的集群 类型,以自动识别要从中收集报告 的节点。-
您可以使用
--cluster或--nodes选项手动设置 cluster 或 nodes 类型。 -
您还可以使用
--master选项将sos程序指向远程节点以确定 集群 类型和 节点列表。因此,您不必登录到其中一个集群节点来收集sos报告;您可以从您的工作站来做。 -
您可以添加
--upload选项,在生成后立即将sos 报告传输到红帽。 -
可以进一步提供任何有效的
sos report选项,它们会被传递到所有sos报告的执行。例如--batch和--clean选项。
[root@primary-rhel8 ~]# sos collect --nodes=sos-node1,sos-node2 -o process,apache --log-size=50 sos-collector (version 4.2) This utility is used to collect sosreports from multiple nodes simultaneously. It uses OpenSSH's ControlPersist feature to connect to nodes and run commands remotely. If your system installation of OpenSSH is older than 5.6, please upgrade. An archive of sosreport tarballs collected from the nodes will be generated in /var/tmp/sos.o4l55n1s and may be provided to an appropriate support representative. 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 configuration changes will be made to the system running this utility or remote systems that it connects to. Press ENTER to continue, or CTRL-C to quit Please enter the case id you are collecting reports for: <8-digit_case_number> sos-collector ASSUMES that SSH keys are installed on all nodes unless the --password option is provided. The following is a list of nodes to collect from: primary-rhel8 sos-node1 sos-node2 Press ENTER to continue with these nodes, or press CTRL-C to quit Connecting to nodes... Beginning collection of sosreports from 3 nodes, collecting a maximum of 4 concurrently primary-rhel8 : Generating sosreport... sos-node1 : Generating sosreport... sos-node2 : Generating sosreport... primary-rhel8 : Retrieving sosreport... sos-node1 : Retrieving sosreport... primary-rhel8 : Successfully collected sosreport sos-node1 : Successfully collected sosreport sos-node2 : Retrieving sosreport... sos-node2 : Successfully collected sosreport The following archive has been created. Please provide it to your support team. /var/tmp/sos-collector-2022-04-15-pafsr.tar.xz [root@primary-rhel8 ~]#-
您可以使用
验证
验证
sos collect命令在/var/tmp/目录中创建了与命令输出中描述匹配的存档。[root@primary-rhel8 ~]# ls -l /var/tmp/sos-collector* -rw-------. 1 root root 160492 May 15 13:35 /var/tmp/sos-collector-2022-05-15-pafsr.tar.xz