简介
本文档介绍与RCM中日志生成日志文件的模式及其恢复相关的问题。
概述
在RCM中,为每个组件(Pod)生成日志收集文件,并最多保留4天,之后RCM会自动删除这些日志文件。
根据RCM中的配置:
Max number of files which can be generated = 10
(can vary as per the RCM docker config but it should be 9/10)
Max size of per file =10Mb
(can vary as per the RCM docker config but 10Mb is majorly defined)
问题
在3到10分钟的时间范围内创建日志文件。一旦RCM累积10个文件,它就会删除旧文件,这就是过去4天的日志文件不被保留的原因。
故障排除
关注点:需要注意的问题是快速生成大量文件,从而快速达到10个文件的阈值。
查看其中一个日志文件时,您发现了错误事件。似乎某些额外事件在调试级别触发,如本文所述。
{"log":"2023/03/14 10:04:44.399 [DEBUG] [ApplicationContext.go:1922] [infra.application.core] Ping method is found for the rpc rcm-checkpointmgr-19, host rcm-checkpointmgr-191\n","stream":"stdout","time":"2023-03-14T10:04:44.399280518Z"}
{"log":"2023/03/14 10:04:44.399 [DEBUG] [ApplicationContext.go:1760] [infra.dpd.core] Ping reachable client Id 4 Name: rcm-checkpointmgr-193 Setname: rcm-checkpointmgr-19 Host: rcm-checkpointmgr-19 Port: 9003 Url: \n","stream":"stdout","time":"2023-03-14T10:04:44.399284297Z"}
{"log":"2023/03/14 10:04:47.418 [DEBUG] [ApplicationContext.go:1760] [infra.dpd.core] Ping reachable client Id 2 Name: rcm-checkpointmgr-141 Setname: rcm-checkpointmgr-14 Host: rcm-checkpointmgr-14 Port: 9003 Url: \n","stream":"stdout","time":"2023-03-14T10:04:47.418602948Z"}
{"log":"2023/03/14 10:04:47.418 [DEBUG] [ApplicationContext.go:1760] [infra.dpd.core] Ping reachable client Id 2 Name: rcm-checkpointmgr-111 Setname: rcm-checkpointmgr-11 Host: rcm-checkpointmgr-11 Port: 9003 Url: \n","stream":"stdout","time":"2023-03-14T10:04:47.418606903Z"}
{"log":"2023/03/14 10:04:47.418 [DEBUG] [ApplicationContext.go:1922] [infra.application.core] Ping method is found for the rpc rcm-checkpointmgr-14, host rcm-checkpointmgr-141\n","stream":"stdout","time":"2023-03-14T10:04:47.418610757Z"}
确定的错误事件与在调试级别配置的基础设施日志相关。这些事件会产生大量非必要的Ping可达性事件。因此,每个日志文件都会快速达到10MB的阈值大小,从而导致多个日志文件的累积。
根据建议:
您必须专门为RCM应用配置调试级别日志。必须启用此日志记录配置,RCM才能从其他源过滤掉任何不必要的日志事件。
RCM运营中心日志记录级别
这是建议在RCM中存在的日志记录级别。
logging level application debug
logging level transaction debug
logging level tracing off
logging name infra.application.core level application warn
logging name infra.application.core level transaction warn
logging name infra.application.core level tracing off
logging name infra.dpd.core level application warn
logging name infra.dpd.core level transaction warn
logging name infra.dpd.core level tracing off
logging name infra.config.core level application warn
logging name infra.config.core level transaction warn
logging name infra.config.core level tracing off
logging name infra.heap_dump.core level application warn
logging name infra.heap_dump.core level transaction warn
logging name infra.heap_dump.core level tracing off
logging name infra.resource_monitor.core level application warn
logging name infra.resource_monitor.core level transaction warn
logging name infra.resource_monitor.core level tracing off
logging name infra.topology.core level application warn
logging name infra.topology.core level transaction warn
logging name infra.topology.core level tracing off
logging name infra.transaction.core level application warn
logging name infra.transaction.core level transaction warn
logging name infra.transaction.core level tracing off
logging name infra.diagnostics.core level application warn
logging name infra.diagnostics.core level transaction warn
logging name infra.diagnostics.core level tracing off
纠正这些不正确的日志记录配置后,日志文件不正确的问题得到解决。