从3.4版本以后,在配置文件中有2个参数分别设置快照的清理。默认没有打开。

autopurge.purgeInterval=1 这个参数指定了清理频率,单位是小时,需要填写一个1或更大的整数,默认是0,表示不开启自己清理功能
autopurge.snapRetainCount=3  这个参数和上面的参数搭配使用,这个参数指定了需要保留的文件数目。默认是保留3个。

还有一种方法,系统提供了zkCleanup.sh脚本,执行该脚本也可以手工清理。
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes. dataDir=/data/zookeeper/zkdata
dataLogDir=/data/zookeeper/zkdatalog # the port at which the clients will connect
clientPort=2181 #171102
server.1=10.15.201.83:2888:3888
server.2=10.15.201.84:2888:3888
server.3=10.15.201.85:2888:3888 # the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
autopurge.purgeInterval=1

zookeeper快照清理的更多相关文章

  1. zookeeper定时清理log

    在zookeeper的目录下新建一个脚本,内容如下(zookeeper bin下面也有zkCleanup.sh脚本,原理一样,都是调用java类) shell_dir=$(cd ")&quo ...

  2. zookeeper日志清理

    环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80      zookeeper-3.4.11 一.事务日志和快照日志 ...

  3. zookeeper 事务日志与快照日志

    zookeeper日志各类日志简介 zookeeper服务器会产生三类日志:事务日志.快照日志和log4j日志. 在zookeeper默认配置文件zoo.cfg(可以修改文件名)中有一个配置项data ...

  4. ZooKeepr日志清理【转】

    转自 :@ni掌柜nileader@gmail.com 地址 数据文件管理 默认情况下,ZK的数据文件和事务日志是保存在同一个目录中,建议是将事务日志存储到单独的磁盘上. 1 数据目录 ZK的数据目录 ...

  5. zookeeper 用法和日常运维

    本文以ZooKeeper3.4.3版本的官方指南为基础:http://zookeeper.apache.org/doc/r3.4.3/zookeeperAdmin.html,补充一些作者运维实践中的要 ...

  6. 部署与管理ZooKeeper(转)

    本文以ZooKeeper3.4.3版本的官方指南为基础:http://zookeeper.apache.org/doc/r3.4.3/zookeeperAdmin.html,补充一些作者运维实践中的要 ...

  7. Zookeeper分布式服务协调组件

    1.简介 Zookeeper是一个分布式服务协调组件,是Hadoop.Hbase.Kafka的重要组件,它是一个为分布式应用提供一致性服务的组件.   Zookeeper的目标就是封装好复杂易出错的服 ...

  8. 部署与管理ZooKeeper(版本有点老,3.4.3)

    本文以ZooKeeper3.4.3版本的官方指南为基础:http://zookeeper.apache.org/doc/r3.4.3/zookeeperAdmin.html,补充一些作者运维实践中的要 ...

  9. Centos6下zookeeper集群部署记录

    ZooKeeper是一个开放源码的分布式应用程序协调服务,它包含一个简单的原语集,分布式应用程序可以基于它实现同步服务,配置维护和命名服务等. Zookeeper设计目的 最终一致性:client不论 ...

随机推荐

  1. NTC与PTC压敏电阻在电源电路中起的作用

    https://wenku.baidu.com/view/e39beafdfab069dc502201f9.html 压敏电阻的作用 http://www.eepw.com.cn/article/27 ...

  2. ADO.NET事务

    在发布System.Transaction命名空间之前,可以直接用ADO.NET创建事务,也可以通过组件.特性和COM+运行库(位于System.EnterpriseServices命名空间中)进行事 ...

  3. Java – How to get current date time

    Java – How to get current date time 1. Code SnippetsFor java.util.Date, just create a new Date() Dat ...

  4. unity, Animator.ResetTrigger

    解: 正确的写法应该是:Animator.SetTrigger("unfoldTrigger")Animator.ResetTrigger("unfoldTrigger& ...

  5. 如何使用ODBC搭配dsn链接数据库

    { OdbcConnection cn; OdbcCommand cmd; string MyString; MyString="Select * from Customers"; ...

  6. Traefik Kubernetes 初试

    traefik 是一个前端负载均衡器,对于微服务架构尤其是 kubernetes 等编排工具具有良好的支持:同 nginx 等相比,traefik 能够自动感知后端容器变化,从而实现自动服务发现:今天 ...

  7. csc.exe已退出,代码为-532462766

    我的surface pro4爆屏了 打电话给微软客服,那边说3,4天内给我回复 只能转移源码等资料到老电脑上,老电脑是神舟 精盾K480N I7D2,装的是WIN10预览版build 1625.rs2 ...

  8. 译:1. 初识 Apache Axis2

    欢迎使用Apache Axis2 / Java Apache Axis2 是一个Web Service  SOAP / WSDL 引擎,它被广泛用于Apache Axis SOAP 栈. Apache ...

  9. Mac OS X 10.8.5 安装编译glib

    过程比较坎坷,就此记录一番一遍后人 1. 下载pkg-config然后解压安装: ./configure make -j 24 sudo make install 2.下载libiconv解压安装 . ...

  10. 如何使用xilinx pcie的源代码

    采用xilinx公司的ml555开发板,软件开发环境是ISE13.2 步骤:一,建立一个ISE工程:BMDforPCIE工程的建立方法:bmd_sx50t文件夹包含BMD Desin for the ...