戴尔自动化平台:如何检索日志包以进行故障处理
Summary: 本文介绍如何检索日志包以对问题进行故障处理 Dell Automation Platform (On Prem)
Instructions
创建此工具是为了收集本地安装的所有 Dell Automation Platform Kubernetes 日志。它还收集本机 Kubernetes 日志,并收集当前状态的 pod 描述。它收集系统日志和 journald 日志。收集后,它会创建一个 tarball 以提供给工程团队。它并非设计用于软件即服务 (SAAS) Dell Automation Platform 安装。
此工具遍历 Dell Automation Platform 和 Knative pod 并列出其中的容器。有关说明,请参阅下面的示例。 hzp-product-svc中的用户名和密码:
root@labmachine01:/nas/tools# kubectl get po -n hzp hzp-product-svc-00001-deployment-5695678c66-79zwm -o jsonpath="{.spec.containers[*].name}"
hzp-ese-svc hzp-product-svc queue-proxy hzp-iam-proxy
例如,用户在 tarball中的用户名和密码:
root@labmachine01:/nas/tools# tar -tf /tmp/native_edge_eo-logs_default_2023-08-30T07-13-39.750/native_edge_eo-logs_default_2023-08-30T07-13-39.750.tar.gz | grep product ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/ ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-iam-proxy.current.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-product-svc.current.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-product-svc-00001-deployment-5695678c66-79zwm.hzp-iam-proxy-init.init.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-product-svc-00001-deployment-5695678c66-79zwm.describe ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-ese-svc.previous.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/queue-proxy.current.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/queue-proxy.previous.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-ese-svc.current.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-product-svc.previous.log ./native_edge_eo-logs_default_2023-08-30T07-13-39.750/hzp/hzp-product-svc-00001-deployment-5695678c66-79zwm/hzp-iam-proxy.previous.log
因此,这些文件采用以下结构进行存储:
namespace/pod-name/namespace-container.log
用法:
首先,用户必须连接并登录您的 Dell Automation Platform 虚拟机。
然后,用户必须启用 root 权限 (sudo -i 或 su 如果已启用)。
要收集所有相关日志,用户必须下载名为 logs_pkb.zip 从本文到 Dell Automation Platform 虚拟机。
提取安装程序的内容。
unzip logs_pkb.zip -d logs-tool
转到该目录并运行脚本:
./logs.sh
执行后,用户会看到一条有关可用空间的信息性消息和继续操作的提示(输入“y”以继续):
This script will access your local k3s secrets (secret values are not going to be printed). This script will collect all logs from all pods in NativeEdge-controlled namespaces and archive it in tarball. Please press "y" if you agree with this. You have 69G available on your storage. Consider that logs may require to have more that 1Gb of free space.
从版本 1.0-rc 开始,日志收集工具会检测 NativeEdge 或 Dell Automation Platform 是否安装到非默认命名空间中。如果工具找不到标准命名空间,它会提示用户输入有效的 Orchestrator 命名空间。请参阅下面的示例
Available namespaces:
- default
- nativeedge
- kube-node-lease
- kube-public
- kube-system
- longhorn-system
- metallb-system
Warning: Namespace 'hzp' not found.
Please enter the namespace containing the 'nativeedge' containers:
如果有默认命名空间安装,该工具将显示列表中的命名空间包括哪些集合:
Namespace 'hzp' found. Logs will be collected from following namespaces:
- hzp
- kube-system
- istio-system
- knative-eventing
- knative-serving
- longhorn-system
事件捕获:
从该工具的 0.9-beta 版本开始,系统会提示用户有关 EdgeOrchestrator/Dell Automation Platform 事件捕获的信息:
Do you want to collect the EO events (WARNING: this may require significant space on disk)?
这会将事件从 EdgeOrchestrator/Dell Automation Platform 直接捕获到日志中 tarball 并改进故障处理。建议在计算机上有足够空间的情况下获取 EdgeOrchestrator/Dell Automation Platform 事件。
如果用户有其他说明,则可以在运行之前检查脚本的可用选项:
./logs.sh -h
用户可以通过以下命令检查当前版本:
logs.sh -v
跳过数据库收集
--skip-database 标志
./logs.sh --skip-database
Skipping PostgreSQL database dump (--skip-database flag set)
Additional Information
此工具可用于所有 On Prem Dell Automation Platform 安装版本 1.0 及更高版本。
此工具可用于所有 NativeEdge Orchestrator 2.0 及更高版本。