您怎么知道何时在Kafka经纪人上创建主题

您怎么知道何时在Kafka经纪人上创建主题

本文介绍了您怎么知道何时在Kafka经纪人上创建主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您怎么知道在Kafka中创建主题的时间?

How do you know when was a topic created in Kafka?

似乎某些主题创建的分区数量错误.有没有办法知道主题的创建日期?假设创建了一个名为"test"的主题,其分区数为 n 个.我如何找到在Kafka上创建测试"主题的日期和时间?

It seems that a few of the topics were created with a wrong number of partitions. Is there a way to know the date the topic was created? Supposedly, a topic with the name "test" was created with n number of partitions. How can I find the date and time when this "test" topic was created on Kafka?

推荐答案

您可以在以下位置看到Kafka主题创建时间(ctime)上次修改时间(mtime)动物园管理员统计信息.

You can see the Kafka topic creation time(ctime) and last modified time(mtime) in zookeeper stat.

首次登录Zookeeper Shell,并添加命令"stat"

First login to zookeeper shell and add command "stat "

kafka % bin/zookeeper-shell.sh localhost:2181 stat /brokers/topics/test-events

它将返回以下详细信息:

It will return below details:

Connecting to localhost:2181

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
cZxid = 0x1007ac74c
ctime = Thu Nov 01 10:38:39 UTC 2018
mZxid = 0x4000f6e26
mtime = Mon Jan 07 05:22:25 UTC 2019
pZxid = 0x1007ac74d
cversion = 1
dataVersion = 8
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 112
numChildren = 1

您可以参考此文件以了解属性: https://zookeeper.apache.org/doc/current/zookeeperProgrammers.html#sc_zkStatStructure

You can refer this to understand the attributes : https://zookeeper.apache.org/doc/current/zookeeperProgrammers.html#sc_zkStatStructure

这篇关于您怎么知道何时在Kafka经纪人上创建主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 17:04