你怎么知道一个主题是什么时候在 Kafka 代理上创建的? [英] How do you know when was a topic created on a Kafka broker?

查看:45
本文介绍了你怎么知道一个主题是什么时候在 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 代理上创建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆