2.2. 从失败安装中收集日志
如果您为安装程序提供了 SSH 密钥,则可以收集有关失败安装的数据。
注意
与从正在运行的集群收集日志相比,您可以使用其他命令收集失败安装的日志。如果必须从正在运行的集群中收集日志,请使用 oc adm must-gather
命令。
先决条件
- 在 bootstrap 过程完成前,OpenShift Container Platform 安装会失败。bootstrap 节点正在运行,并可通过 SSH 访问。
-
ssh-agent
进程在您的计算机上处于活跃状态,并且为ssh-agent
进程和安装程序提供了相同的 SSH 密钥。 - 如果尝试在您置备的基础架构上安装集群,则必须具有 bootstrap 和 control plane 节点的完全限定域名。
流程
生成从 bootstrap 和 control plane 机器获取安装日志的命令:
如果您使用安装程序置备的基础架构,请切换到包含安装程序的目录,并运行以下命令:
./openshift-install gather bootstrap --dir <installation_directory>
$ ./openshift-install gather bootstrap --dir <installation_directory>
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
installation_directory
是您在运行时指定的目录。/openshift-install create cluster
。此目录包含安装程序创建的 OpenShift Container Platform 定义文件。
对于安装程序置备的基础架构,安装程序会保存有关集群的信息,因此您不用指定主机名或 IP 地址。
如果您使用您置备的基础架构,请切换到包含安装程序的目录,并运行以下命令:
./openshift-install gather bootstrap --dir <installation_directory> \ --bootstrap <bootstrap_address> \ --master <master_1_address> \ --master <master_2_address> \ --master <master_3_address>
$ ./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 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意默认集群包含三台 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"
INFO Pulling debug logs from the bootstrap machine INFO Bootstrap gather logs captured here "<installation_directory>/log-bundle-<timestamp>.tar.gz"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您提交有关安装失败的红帽支持问题单,请在问题单中包含压缩日志。