22.2. 从失败安装中收集日志

如果您为安装程序提供了 SSH 密钥,则可以收集有关失败安装的数据。

注意

与从正在运行的集群收集日志相比,您可以使用其他命令收集失败安装的日志。如果必须从正在运行的集群中收集日志,请使用 oc adm must-gather 命令。

先决条件

  • 在 bootstrap 过程完成前,OpenShift Container Platform 安装会失败。bootstrap 节点正在运行,并可通过 SSH 访问。
  • ssh-agent 进程在您的计算机上处于活跃状态,并且为 ssh-agent 进程和安装程序提供了相同的 SSH 密钥。
  • 如果尝试在您置备的基础架构上安装集群,则必须具有 bootstrap 和 control plane 节点的完全限定域名。

流程

  1. 生成从 bootstrap 和 control plane 机器获取安装日志的命令:

    • 如果您使用安装程序置备的基础架构,请切换到包含安装程序的目录,并运行以下命令:

      $ ./openshift-install gather bootstrap --dir <installation_directory> 1
      1
      installation_directory 是您在运行时指定的目录 。/openshift-install create cluster。此目录包含安装程序创建的 OpenShift Container Platform 定义文件。

      对于安装程序置备的基础架构,安装程序会保存有关集群的信息,因此您不用指定主机名或 IP 地址。

    • 如果您使用您置备的基础架构,请切换到包含安装程序的目录,并运行以下命令:

      $ ./openshift-install gather bootstrap --dir <installation_directory> \ 1
          --bootstrap <bootstrap_address> \ 2
          --master <master_1_address> \ 3
          --master <master_2_address> \ 4
          --master <master_3_address>" 5
      1
      对于 installation_directory,请指定您在运行时指定的同一目录 。/openshift-install create cluster。此目录包含安装程序创建的 OpenShift Container Platform 定义文件。
      2
      <bootstrap_address> 是集群 bootstrap 机器的完全限定域名或 IP 地址。
      3 4 5
      对于集群中的每个 control plane 或 master 机器,将 <master_*_address> 替换为其完全限定域名或 IP 地址。
      注意

      默认集群包含三台 control plane 机器。如所示,列出所有 control plane 机器,无论您的集群使用了多少个。

    输出示例

    INFO Pulling debug logs from the bootstrap machine
    INFO Bootstrap gather logs captured here "<installation_directory>/log-bundle-<timestamp>.tar.gz"

    如果您提交有关安装失败的红帽支持问题单,请在问题单中包含压缩日志。