我将AWS MSK群集与经纪人登录到CloudWatch。登录作品,我可以看到经纪人日志。我们有一些主题, clearup.policy = compact
和 callicup.policy = delete
。该系统在新集群上运行大约2周。
根据我的研究(例如-Into-kafka-log-compaction-5E520F4291F0 )我看到kafka应该运行日志清洁器(显然),并且该活动的日志中应该有一些痕迹。但是,在我的CloudWatch日志组中,我找不到一个单词“清洁器”或“清洁”,我找不到运行的日志清洁器的痕迹。
日志清洁器根本运行吗?显然应该这样做,但我在日志中找不到任何东西来确认这一点,而且我们有很多符合清理资格但仍未清理的消息,大约两个星期。
Kafka群集版本为2.8.1
I use AWS MSK cluster with brokers logging turned on to CloudWatch. Logging works and I can see brokers logs. We have some topics with cleanup.policy=compact
and some with cleanup.policy=delete
. The system is running on the new cluster for about 2 weeks now.
From my research (e.g. https://zendesk.engineering/an-investigation-into-kafka-log-compaction-5e520f4291f0) I see that kafka should run log cleaner (obviously) and there should be some traces in logs of this activity. However in my CloudWatch log group I cannot find a word "cleaner" or "cleaned" and I cannot find any trace of log cleaner running.
Is log cleaner running at all? It obviously should but I can't find anything in the logs to confirm this, and also we have a lot of messages eligible for cleanup but still not cleaned, for about 2 weeks now.
Kafka cluster version is 2.8.1
发布评论
评论(1)
这些日志很可能没有在MSK中显示,因为默认情况下,它们没有从: https://jaceklaskowski.gitbooks.io/apache-kafka/content/kafka-log-log-log-log-log-log-log-log-logcleaner.html
不过,这有点误导,因为
logCleaner
要照顾紧凑的主题,我不确定已记录何处(或在哪个日志级别上,因为AWS MSK仅导出 info级logs logs )带有delete> delete
delete> delete 清理政策。我会联系AWS支持,以了解是否有办法或知道他们对这些日志有什么作用。
另外,您可以尝试设置 prometheus 将使Kafka导出的所有指标都向JMX出口。如果启用了,则应有 metric(max-clean time-sec)至少会告诉您它是否正在运行,并且您可能会获得其他一些有趣的信息来解决问题。
It is quite likely these logs are not being show in MSK since it seems that, by default, they do not go to the main log stream, from: https://jaceklaskowski.gitbooks.io/apache-kafka/content/kafka-log-LogCleaner.html
It is a bit misleading though because the
LogCleaner
takes care of compacted topics, I'm not sure where is logged (or at which log level since AWS MSK only exports INFO level logs) the deletion of messages in topics withdelete
cleanup policy.I would contact AWS support to know if there is a way or to know what do they do with these logs.
Alternatively, you could try to set up open monitoring with Prometheus which will get all metrics exported by Kafka to JMX. If enabled, there should be a metric (max-clean-time-sec) that, at least, will tell you if it is running and you may get some other interesting information to troubleshoot your issue.