该日志收集器项目旨在收集 Linux 的 Kubernetes 节点日志。它设计用于以下环境,用于故障排除支持案例:

RKE2 clusters
RKE1 clusters
K3s clusters
Custom clusters
Infrastructure provider clusters
Kubeadm clusters

在排查问题时,支持团队可能会要求你生成并提供包含诊断信息的日志包。
Resolution  结局

Note:  注:
This command requires curl or wget to be installed, and internet access from the node.
该命令需要安装 curl 或 wget 以及节点的互联网访问。

Logs can be collected from a Linux node using the Rancher v2.x log collector script.
可以通过 Rancher v2.x 日志收集脚本从 Linux 节点收集日志。

The script needs to be downloaded and run directly on the node, using the root user or sudo.
脚本需要下载并直接在节点上运行,使用 root 用户或 sudo。

Output will be written to /tmp as a tar.gz archive named <hostname>-<date>.tar.gz, the default output directory can be changed with the -d flag.
输出会写入 /tmp,作为名为 <hostname>-<date>.tar.gz 的 tar.gz 归档,默认输出目录可用 -d 标志更改。

  1. Download the script as: rancher2_logs_collector.sh
    下载剧本格式为:rancher2_logs_collector.sh

    Using wget:  使用 wget

wget --backups https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh
  1. Using curl:  使用卷发 

curl -OLs https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh
  1. Run the script:  运行脚本:

sudo bash rancher2_logs_collector.sh

Optional: Download and run the script in one command
可选:用一个命令下载并运行脚本

curl -Ls rnch.io/rancher2_logs | sudo bash

     

For details on what information is collected, please refer to the Rancher v2.x log collector script README Scope of Collection section.
有关收集信息的详细信息,请参阅 Rancher v2.x 日志采集脚本 README 收集范围部分。

Cause  病因
Additional Information  附加信息
For additional options, please refer to the Rancher v2.x log collector script README Flags section.
如需更多选项,请参阅 Rancher v2.x 日志收集脚本 README 标志部分。

访问Rancher-K8S解决方案博主,企业合作伙伴 :
https://blog.csdn.net/lidw2009

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐