Zookeeper数据目录清理 [英] Zookeeper data directory cleanup

查看:92
本文介绍了Zookeeper数据目录清理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行3个节点的zookeeper集群来处理风暴和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.

  1. 停止zookeeper(/opt/zookeeper-3.4.6/bin/zkServer.sh stop )
  2. cd/opt/zookeeper-3.4.6
  3. ./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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆