Clean Up Your Zookeeper History

Posted by in IT

TL;DR: Use zkCleanup.sh -n 5 command:

By default, Zookeeper does not delete any of its history to allow recovery. This however can lead to disk space issues over long-ish periods of time. Therefore, it is advisable to clean up once in a while.

Update: I found out that /usr/share/zookeeper/bin contains a script named zkCleanup.sh. You can use it to remove the old logs:

It basiacally executes the command line below:

The manual way

My configuration is:

  • The database is located on /var/lib/zookeeper

  • zookeeper.jar and slf4j-api.jar in /usr/share/java

Although it adds about 66Mb each time helios is run, it’s worth running only when a helios deployment has been successful and, even then, keep some history. We have a convention that at least 5 “steps” should be kept.

You might want to script this in a nice command (which you’d need to run with sudo):

HTH,


A little experiment: If you find this post and ad below useful, please check the ad out :-)