6
votes

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?

2

2 Answers

6
votes

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.

4
votes
  1. Stop Zookeeper
  2. Go to the bin folder of your Zookeeper
  3. Run ./zkCli.sh
  4. Use ls / to check Zookeeper's content
  5. Identify what you want to delete with the exact path
  6. Delete /znode or path of what you want to delete