Zookeeper data directory cleanup
Asked Answered
T

2

6

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?

Triliteral answered 2/2, 2016 at 12:55 Comment(0)
H
9

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.

Houstonhoustonia answered 5/6, 2018 at 0:42 Comment(2)
Note that you do not need to shutdown zookeeper to cleanup old snapshots. They aren't live data.Benue
As with 3.4.5 version, the clean command is just: ./bin/zkClean.sh -n 10. The dataLogDir parameter shouldn't be added.Joly
H
4
  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
Horseback answered 30/12, 2016 at 17:30 Comment(2)
Where is " bin folder of Zookeeper"?Ictinus
bin folder u'll see after login to docker container like: docker exec -it <container-id> shBeaudette

© 2022 - 2024 — McMap. All rights reserved.