Dell NativeEdge:如何检索 NativeEdge Orchestrator 和 Dell Automation Platform 日志包以进行故障处理
摘要: 本文介绍如何检索日志包,以对 NativeEdge Orchestrator 和戴尔自动化平台的问题进行故障处理。
说明
创建此工具是为了收集所有 NativeEdge Orchestrator 和戴尔自动化平台 Kubernetes 日志。它还收集本机 Kubernetes 日志,并收集当前状态下的 Pod 描述。它还收集系统日志和日志。收集后,它会创建一个 tarball 以提供给工程团队。
此工具遍历 NativeEdge 或戴尔自动化平台和 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
用法:
首先,用户必须连接并登录 NativeEdge Orchestrator (Dell Automation Platform) 计算机。
然后,用户必须启用 root 权限(sudo -i 或 su,如果已启用)。
要收集所有相关日志,用户必须将本文中名为 logs_pkb.zip 的附件下载到 NativeEdge Orchestrator 计算机。
解压归档的内容:
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 或戴尔自动化平台是否已安装到非默认命名空间中。如果该工具未找到标准命名空间,则会提示用户输入有效的 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/戴尔自动化平台直接捕获到日志压缩包中,并改进故障处理。建议在计算机上有足够的空间时获取 EdgeOrchestrator/Dell Automation Platform 事件。
如果用户有其他说明,用户可以在运行脚本之前检查脚本的可用选项:
./logs.sh -h
用户可以通过以下命令检查当前版本:
logs.sh -v