Spread the loveKafka Topics List existing topics bin/kafka-topics.sh –zookeeper localhost:2181 –list Purge a topic bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –config retention.ms=1000 … wait a minute … bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –delete-config retention.ms
Every node in a ZooKeeper tree is referred to as a znode
Znodes maintain a stat structure that include, Version numbers, ACL ,Timestamp, Data length
Version number − Every znode has a version number, which means every time the data associated with the znode changes, its corresponding version number would also increased.
(ACL) − ACL is basically an authentication mechanism for accessing the znode. It represents read and write permisions on znode.
Timestamp − Timestamp represents time elapsed from znode creation and modification. It is usually represented in milliseconds.
Data length − Total amount of the data stored in a znode is the data length. You can store a maximum of 1MB of data.
Type of znodes: we have 3 types of znodes they are persistence, ephemeral and sequential.
Persistence znode is alive until they’re explicitly deleted, A znode can be deleted by calling the delete API call.
Ephemeral znodes are active until the client connection is alive. When a client gets disconnected from the ZooKeeper ensemble, then the ephemeral znodes get deleted automatically
Sequential znodes can be either persistent or ephemeral. When a new znode is created as a sequential znode, then ZooKeeper sets the path of the znode by attaching a 10 digit unique sequence number to the original name. Sequential znodes play an important role in Locking and Synchronization.