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


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

先决条件

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

流程

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

    注意

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

    1. 您可以使用 --cluster--nodes 选项手动设置 clusternodes 类型。
    2. 您还可以使用 --master 选项将 sos 程序指向远程节点以确定 集群 类型和 节点列表。因此,您不必登录到其中一个集群节点来收集 sos 报告;您可以从您的工作站来做。
    3. 您可以添加 --upload 选项,在生成后立即将 sos 报告 传输到红帽。
    4. 可以进一步提供任何有效的 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 ~]#
    Copy to Clipboard Toggle word wrap

验证

  • 验证 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
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat