zookeeper清理日志
admin
2023-05-25 03:01:23
0


一、描述

    大早上刚到公司就发现报警,磁盘容量告警,zookeeper集群服务器报警。


二、处理过程


  1. 查看磁盘空间

df -h


2.确认那个目录占用空间比较多,发现是zookeeper

修改zookeeper参数文件(版本3.4.6)

vi zoo.cfg

# The number of snapshots to retain in dataDir

autopurge.snapRetainCount=20    #保留log和snapshot各20个

# Purge task interval in hours

# Set to "0" to disable auto purge feature

autopurge.purgeInterval=1    #每小时清理一次


3.查看状态

$ /usr/local/RoilandGroup/zookeeper/bin/zkServer.sh status

JMX enabled by default

Using config: /usr/local/RoilandGroup/zookeeper/bin/../conf/zoo.cfg

Mode: leader


4.关闭服务

$ /usr/local/RoilandGroup/zookeeper/bin/zkServer.sh stop

JMX enabled by default

Using config: /usr/local/RoilandGroup/zookeeper/bin/../conf/zoo.cfg

Stopping zookeeper ... STOPPED


5.重启服务

$ /usr/local/RoilandGroup/zookeeper/bin/zkServer.sh start

JMX enabled by default

Using config: /usr/local/RoilandGroup/zookeeper/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

[hadoop@host-10-60-40-37 conf]$ jps

8118449 QuorumPeerMain


6.zookeeper集群中每一个节点都需要修改参数文件,然后重启服务.

至于为什么这么修改,是否还有其他的方式,大家可以看官方文档,或者比较懒就百度。



7.理解每一个参数文件,看注释就行


less zoo.cfg

# 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

# the port at which the clients will connect

clientPort=2181

# 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=20

# Purge task interval in hours

# Set to "0" to disable auto purge feature

autopurge.purgeInterval=1

#####################################################

#####################################################

#####################################################

server.1=10.10.10.11:2888:3888

server.2=10.10.10.12:2888:3888

server.3=10.10.10.13:2888:3888

server.4=10.10.10.14:2888:3888

server.5=10.10.10.15:2888:3888


相关内容

热门资讯

12岁摩洛哥男孩哭求留在西班牙... 在西班牙北非飞地休达,一名12岁摩洛哥孤身男孩在被士兵押送遣返时,当场哭喊恳求不要把自己送回国。行至...
美国巴西外交冲突升级了! 这两个大国,真撕破脸了。一个是美国,世界老大;另一个是巴西,拉美No.1。最近的事情,说起来,其实挺...
电脑屏幕怎么截屏(电脑屏幕要怎... 电脑屏幕截屏的方法有很多,可分全屏和任意内容,以系统自带和借助QQ为例,介绍具体操作方法: ...
电脑任务管理器怎么打开 很多人都不知道电脑的.任务管理器应该怎么打开,下面小编为大家带来了电脑任务管理器的打开方法,欢迎大家...
win7系统QQ网络硬盘的位置 有时候我们的工作资料太多了,为了方便储存,就会将资料保存在网络硬盘中,可是很多用户不知道qq网络硬盘...
电脑任务管理器快捷键是什么 电... 同时按下Ctrl+shift+esc三个键或者同时按下Ctrl+Alt+delete三个键都可打开任...
电脑设备管理器在哪 电脑设备管... 点击“此电脑”图标,右键单击选择“管理”,弹出的窗口中点击左侧的“设备管理器”选项即可。
海康机器人申请相机调焦方法专利... 国家知识产权局信息显示,杭州海康机器人股份有限公司申请一项名为“一种相机调焦方法、装置、电子设备及存...
融捷能源申请硅碳负极材料专利,... 国家知识产权局信息显示,广州融捷能源科技有限公司申请一项名为“一种硅碳负极材料、制备方法及锂离子电池...
量子计算机最大的"拦... 就在上周,一件悄悄发生的事,可能比你朋友圈里所有的AI新闻都重要。 英伟达发布了一个专门看量子实验图...