Zookeeper data directory cleanup

核能气质少年 提交于 2019-12-07 03:32:16

问题


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.

  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.




回答2:


  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


来源:https://stackoverflow.com/questions/35154147/zookeeper-data-directory-cleanup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!