DEV Community

Bryan Sazon
Bryan Sazon

Posted on

Cleaning up Zookeeper Logs and Snapshots


Zookeeper’s logs and snapshots are mostly responsible for its high disk usage. If your team makes use of these snapshots for specific purposes, it makes sense to back them up using your tool of preference.

My team uses ClickHouse and it uses Zookeeper for replication. So in our case, we don't need to keep snapshots.


To clean up manually, all you have to do is run the cleanup script.

# Go to wherever zookeeper bin is installed in your server
cd /opt/zookeeper/bin 

# Run the script
./ -n 10

Where 10 is the number of old snaps/logs you want to keep, the value should be greater than or equal to 3.

Repeat the completed steps to all the Zookeeper replica server.

See the script for reference.

Top comments (0)