Clean Up Your Zookeeper History

TL;DR: Use -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 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):


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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top