簡介
本文檔介紹與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
糾正這些不正確的日誌記錄配置後,解決了日誌檔案不正確的問題。