Clean Up Your Zookeeper History

Posted by in IT

TL;DR: Use org.apache.zookeeper.server.PurgeTxnLog 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.

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 :-)