Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zookeeper data directory cleanup

I am running 3 node zookeeper cluster to process storm and kafka.Zookeeper Data directory eats up all the space in my system.I am not sure how to clean it up.As, I don't want to delete the data entirely because i will lose the state of the processes.I looked into autopurge.purgeInterval in zoo.cfg, but it doesn't work as I expected.

I am using zookeeper 3.4.6

How can I delete the old data without affecting the new ones?

like image 970
user4974500 Avatar asked Feb 02 '16 12:02

user4974500


1 Answers

Assuming you have zookeeper installed in /opt/zookeeper-3.4.6, the following will delete all but the last 10 snapshots.

  1. stop zookeeper (/opt/zookeeper-3.4.6/bin/zkServer.sh stop)
  2. cd /opt/zookeeper-3.4.6
  3. ./zkCleanup.sh ../data/ -n 10

Probably wise to make a backup of the whole /opt/zookeeper-3.4.6 dir before doing this.

like image 199
clumsyjedi Avatar answered Oct 13 '22 01:10

clumsyjedi