I am using a kafka cluster with three brokers, I would like to know the topics resides in this cluster, for each topic, how many partitions we have and what is TTL related to them.
How to identify such things in a horthonwork cluster?
the script "kafka-topics.sh" with parameter "--describe" is what you are looking for.
To get details for a certain topic, e.g. "test-topic", you would call (adjust zookeeper connect string according to your env.):
/usr/hdp/current/kafka-broker/bin/kafka-topics.sh --zookeeper sandbox.hortonworks.com:2181/kafka --describe --topic test-topic
The output contains (amongst others) no. of partitions, leading broker for each partition, in-snyc-replicas
The topic-level configuration properties are listed under "Configs:" . If this is blank, then the default (broker-wide) settings are applied and you should check your broker config file (or Ambari section) for property "log.retention.hours" ...... assuming you mean the retention time by mentioning "TTL"