1.4. 同时在多个系统中生成并收集 sos 报告


您可以使用 sos 程序在多个系统上触发 sos report 命令。等待报告终止并收集所有生成的报告。

先决条件

  • 您知道要在其上运行的集群类型或节点列表。
  • 您已安装了所有系统上的 sos 软件包。
  • 在所有系统中具有 root 帐户的 ssh 密钥,或者您可以通过 --password 选项提供 root 密码。

步骤

  • 运行 sos collect 命令并按照屏幕上的说明进行操作。

    注意

    默认情况下,sos collect 会尝试识别在其上运行的集群类型,以自动识别要从其中收集报告的节点

    1. 您可以使用 --cluster--nodes 选项来手工设置集群节点类型。
    2. 您还可以使用 --master 选项指定在远程节点上的 sos 程序来确定集群类型和节点列表。因此,您不必登录到其中一个集群节点来收集 sos 报告;您可以从您的工作站进行。
    3. 您可以添加 --upload 选项,以在生成后将 sos 报告 立即发送到红帽。
    4. 可以进一步提供任何有效的 sos report 选项,它们会被传递到所有 sos 报告的执行。例如 --batch--clean 选项。
[root@primary-rhel9 ~]# 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-rhel9
    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-rhel9 : Generating sosreport...
sos-node1  : Generating sosreport...
sos-node2 : Generating sosreport...
primary-rhel9 : Retrieving sosreport...
sos-node1  : Retrieving sosreport...
primary-rhel9  : 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-05-15-pafsr.tar.xz

[root@primary-rhel9 ~]#
Copy to Clipboard Toggle word wrap

验证

  • 验证 sos collect 命令在 /var/tmp/ 目录中创建了与命令输出的描述匹配的存档。

    [root@primary-rhel9 ~]# 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
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat