Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2758875
  • 博文数量: 587
  • 博客积分: 6356
  • 博客等级: 准将
  • 技术积分: 6410
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-23 10:54
个人简介

器量大者,福泽必厚

文章分类

全部博文(587)

文章存档

2019年(3)

2018年(1)

2017年(29)

2016年(39)

2015年(66)

2014年(117)

2013年(136)

2012年(58)

2011年(34)

2010年(50)

2009年(38)

2008年(16)

分类: LINUX

2016-05-30 16:51:58

autopurge.purgeInternal=20
autopurge.snapRetainCount=5
这两个参数在生产环境下尤其重要!
从3.4.0开始,zookeeper提供了自动清理snapshot和事务日志的功能,通过配置 autopurge.snapRetainCount 和 autopurge.purgeInterval 这两个参数能够实现定时清理了。这两个参数都是在zoo.cfg中配置的:

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

常用的三个命令:conf\stat\ruok
[root@***conf]# echo conf | nc 127.0.0.1 2181
clientPort=2181
dataDir=/usr/local/zookeeper/data/version-2
dataLogDir=/usr/local/zookeeper/data/version-2
tickTime=2000
maxClientCnxns=60
minSessionTimeout=4000
maxSessionTimeout=40000
serverId=1
initLimit=10
syncLimit=5
electionAlg=3
electionPort=3888
quorumPort=2888
peerType=0
[root@** conf]# echo ruok | nc 127.0.0.1 2181
imok

[root@** conf]# echo stat | nc 127.0.0.1 2181
Zookeeper version: 3.4.6-1569965, built on 02/20/2014 09:09 GMT
Clients: /127.0.0.1:25284[0](queued=0,recved=1,sent=0)
Latency min/avg/max: -1184/0/983
Received: 139014121
Sent: 139014125
Connections: 1
Outstanding: 0
Zxid: 0x800000238
Mode: follower
Node count: 13265
[root@mail ~]# which nc
/usr/bin/which: no nc in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/data/mysql/bin:/usr/local/java/bin:/root/bin)
[root@mail ~]# yum whatprovides /usr/bin/nc
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.sina.cn
 * extras: mirrors.sina.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
base                                                                                                                                                                    | 3.7 kB     00:00     
base/primary_db                                                                                                                                                         | 4.7 MB     00:01     
erlang-solutions                                                                                                                                                        |  951 B     00:00     
extras                                                                                                                                                                  | 3.4 kB     00:00     
extras/primary_db                                                                                                                                                       |  36 kB     00:00     
updates                                                                                                                                                                 | 3.4 kB     00:00     
updates/primary_db                                                                                                                                                      | 726 kB     00:01     
nc-1.84-24.el6.x86_64 : Reads and writes data across network connections using TCP or UDP
Repo        : base
Matched from:
Filename    : /usr/bin/nc

rpm  -qf  /usr/bin/nc  ##也可也查出nc命令来自于哪个rpm包!

阅读(1506) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~