Zookeeper 数据目录清理 [英] Zookeeper data directory cleanup
问题描述
我正在运行 3 节点 zookeeper 集群来处理 Storm 和 kafka.Zookeeper 数据目录占用了我系统中的所有空间.我不知道如何清理它.因为,我不想完全删除数据因为我会丢失进程的状态.我查看了 zoo.cfg
中的 autopurge.purgeInterval
,但它没有按我预期的那样工作.
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.
我使用的是zookeeper 3.4.6
I am using zookeeper 3.4.6
如何在不影响新数据的情况下删除旧数据?
How can I delete the old data without affecting the new ones?
推荐答案
假设您在 /opt/zookeeper-3.4.6
中安装了 zookeeper,以下将删除除最后 10 个快照之外的所有快照.
Assuming you have zookeeper installed in /opt/zookeeper-3.4.6
, the following will delete all but the last 10 snapshots.
- 停止zookeeper (
/opt/zookeeper-3.4.6/bin/zkServer.sh stop
) cd/opt/zookeeper-3.4.6
./zkCleanup.sh ../data/-n 10
在执行此操作之前备份整个/opt/zookeeper-3.4.6 目录可能是明智的.
Probably wise to make a backup of the whole /opt/zookeeper-3.4.6 dir before doing this.
这篇关于Zookeeper 数据目录清理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!