问题
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?
回答1:
Assuming you have zookeeper installed in /opt/zookeeper-3.4.6
, the following will delete all but the last 10 snapshots.
- stop zookeeper (
/opt/zookeeper-3.4.6/bin/zkServer.sh stop
) cd /opt/zookeeper-3.4.6
./zkCleanup.sh ../data/ -n 10
Probably wise to make a backup of the whole /opt/zookeeper-3.4.6 dir before doing this.
回答2:
- Stop Zookeeper
- Go to the bin folder of your Zookeeper
- Run
./zkCli.sh
- Use
ls /
to check Zookeeper's content - Identify what you want to delete with the exact path
- Delete
/znode
or path of what you want to delete
来源:https://stackoverflow.com/questions/35154147/zookeeper-data-directory-cleanup