Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

URGENT - accidentally deleted /config/topics directory inside zookeeper by zkcli.

avatar
Expert Contributor

accidentally deleted /config/topics directory within zookeeper zkcli.

 

so far the kafka cluster is operational, but we need to know what this directory can interfere with in the future?

 

Is it possible to restore this /config/topics directory in zookeeper?

1 REPLY 1

avatar
Expert Contributor

@yagoaparecidoti 

 

A] Generally /config/topics/ will store all topic level configuration if you have set any.

 

For example:

If you have set any topic level setting then it will be stored there:

 

[zk: node1.zookeeper-hostname.com:2181(CONNECTED) 6] get /kafka/config/topics/ATLAS_HOOK

{"version":1,"config":{"retention.ms":"2678400000","cleanup.policy":"compact"}}

[zk:node1.zookeeper-hostname.com:2181(CONNECTED) 7]

 

Here topic level settings are retention.ms and cleanup.policy=compact

 

As it has only topic-level configuration details it will not affect the Kafka cluster or applications if applications are not dependent on any topic-level settings. 

 

B] There is no standard Kafka tool which you can use to restore /config/topics but you can easily alter/set topic level settings using the Kafka command below as per your retirement if any. 

 

kafka-configs --zookeeper <ZK_host>:2181/kafka --entity-type topics --entity-name <topic_name> --alter --add-config <configname & value>

 

Note: Replace all required settings and /kafka (/kafka can be checked from CM >> Kafka >> Conf >> zookeeper.chroot) in the above command

 

If you found this response assisted with your query, please take a moment to log in and click on  KUDOS 🙂 & ”Accept as Solution" below this post.