gpt4 book ai didi

apache-zookeeper - 如何使用PurgeTxnLog清除Zookeeper日志?

转载 作者:行者123 更新时间:2023-12-04 13:26:39 25 4
gpt4 key购买 nike

Zookeeper正在我们的整个生产环境中迅速释放其内部二进制文件。
根据:http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html

http://dougchang333.blogspot.com/2013/02/zookeeper-cleaning-logs-snapshots.html
这是预期的行为,您必须调用org.apache.zookeeper.server.PurgeTxnLog
定期旋转便便。

所以:

% ls -l1rt /tmp/zookeeper/version-2/
total 314432
-rw-r--r-- 1 root root 67108880 Jun 26 18:00 log.1
-rw-r--r-- 1 root root 947092 Jun 26 18:00 snapshot.e99b
-rw-r--r-- 1 root root 67108880 Jun 27 05:00 log.e99d
-rw-r--r-- 1 root root 1620918 Jun 27 05:00 snapshot.1e266
... many more

% sudo java -cp zookeeper-3.4.6.jar::lib/jline-0.9.94.jar:lib/log4j-1.2.16.jar:lib/netty-3.7.0.Final.jar:lib/slf4j-api-1.6.1.jar:lib/slf4j-log4j12-1.6.1.jar:conf \
org.apache.zookeeper.server.PurgeTxnLog \
/tmp/zookeeper/version-2 /tmp/zookeeper/version-2 -n 3

但我得到:
% ls -l1rt /tmp/zookeeper/version-2/
... all the existing logs plus a new directory
/tmp/zookeeper/version-2/version-2

难道我做错了什么?

zookeeper-3.4.6/

最佳答案

从3.4.0开始,ZooKeeper现在具有自动清除功能。看看https://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html

它说您可以使用autopurge.snapRetainCountautopurge.purgeInterval
autopurge.snapRetainCount

New in 3.4.0: When enabled, ZooKeeper auto purge feature retains the autopurge.snapRetainCount most recent snapshots and the corresponding transaction logs in the dataDir and dataLogDir respectively and deletes the rest. Defaults to 3. Minimum value is 3.



autopurge.purge间隔

New in 3.4.0: The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0.

关于apache-zookeeper - 如何使用PurgeTxnLog清除Zookeeper日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31689252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com