简介
本文档介绍冗余配置管理器(RCM)日志收集的一般过程。
RCM日志收集过程
以下是RCM的组件:
- 控制器
- 检查点管理器
- BFDMGR
- OPScenter
- Configmgr
根据问题场景,必须查明可作为捕获日志基础的故障元素。
所有组件的过程都相同,如下所述。
-
如果您需要查看最近的日志,例如最近1到2小时内的日志,您只需收集该特定组件的Pod日志即可。
kubectl get svc -o wide -A -n rcm
With this command, you get all the pods with their IPs and name.
kubectl logs <pod name> -n rcm
Just mention the pod name for which logs are required.
- 如果需要检查超过2小时的日志,则RCM系统最多存储所有生成的日志4天。您可以按照此处列出的步骤检索它们。
1.导航到目录路径: /var/log/containers
,并使用 grep
命令,以搜索所需的特定组件日志。
In this scenario, let's take the controller as an example. If you require logs for configmgr/checkpointmgr, you need to use the 'grep' command, while the rest of the procedure remains unchanged.
root@h10-126-83-128:/var/log/containers# ls -la | grep controller
lrwxrwxrwx 1 root root 107 Mar 29 07:07 rcm-controller-6547b466ff-zsrcd_rcm_rcm-controller-4c149c1e962992a241dd5201aadb07237f52947740724c1df2a01b1b6bfbc671.log -> /var/log/pods/rcm_rcm-controller-6547b466ff-zsrcd_ff74e5fc-9a07-4073-8956-90cd978ac98e/rcm-controller/0.log
2.查找控制器目录。
From Step 1., you can see the controller directory as mentioned here:
/var/log/pods/rcm_rcm-controller-6547b466ff-zsrcd_ff74e5fc-9a07-4073-8956-90cd978ac98e/rcm-controller/0.log
Get into this path
root@h10-126-83-128:/var/log/containers# ls -la /var/log/pods/rcm_rcm-controller-6547b466ff-zsrcd_ff74e5fc-9a07-4073-8956-90cd978ac98e/rcm-controller/
total 12
drwxr-xr-x 2 root root 4096 Mar 29 07:07 .
drwxr-xr-x 3 root root 4096 Mar 29 07:07 ..
lrwxrwxrwx 1 root root 165 Mar 29 07:07 0.log -> /var/lib/docker/containers/4c149c1e962992a241dd5201aadb07237f52947740724c1df2a01b1b6bfbc671/4c149c1e962992a241dd5201aadb07237f52947740724c1df2a01b1b6bfbc671-json.log
3.获取所有 .log
文件(tar/zipped)。
In Step 2, once you have obtained the path where log files are stored, navigate to that path and collect the .log/.gz files as needed.
root@h10-126-83-128:/var/log/containers# ls -la /var/lib/docker/containers/4c149c1e962992a241dd5201aadb07237f52947740724c1df2a01b1b6bfbc671/
total 6448
drwx------ 4 root root 4096 Mar 29 07:07 .
drwx------ 69 root root 12288 Mar 29 07:07 ..
-rw-r----- 1 root root 6548746 Mar 29 10:08 4c149c1e962992a241dd5201aadb07237f52947740724c1df2a01b1b6bfbc671-json.log
drwx------ 2 root root 4096 Mar 29 07:07 checkpoints
-rw------- 1 root root 23306 Mar 29 07:07 config.v2.json
-rw-r--r-- 1 root root 2469 Mar 29 07:07 hostconfig.json
drwx------ 2 root root 4096 Mar 29 07:07 mounts
root@h10-126-83-128:/var/log/containers#