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


相关内容

热门资讯

国安部:境外间谍控制路由器窃密 近期,国家安全机关工作发现,境外间谍情报机关利用我国境内路由器充当“跳板”,以“钓鱼邮件”为掩护,定...
中方大使:中国台湾地区不能参加... 中国台湾地区不能参加世卫大会,原则明确、法理清楚(大使随笔)贾桂德《人民日报》(2026年05月20...
试图扼住“数字咽喉”?伊朗打出... 新华社北京5月19日电(记者柳伟建 王储 胡冠)日前,素有全球“能源咽喉”之称的霍尔木兹海峡,又以“...
企业Agent的新基础设施,飞... 26年开年,随着OpenClaw和Agent的爆火,CLI越来越浮出水面。 Karpathy也说,命...
首闯太空商用成功!成都企业与开... 近日,中国首个实现国际规模商用的开源操作系统开源欧拉称,基于开源欧拉的宇航级嵌入式操作系统搭载某星座...
谷歌携手三星展示2款智能眼镜:... IT之家 5 月 20 日消息,在今日的 2026 谷歌 I/O 开发者大会上,谷歌携手三星公司,展...
AI营销进入深水区 不同路径殊... 中新网上海新闻5月18日电(李佳佳)人工智能从能力验证走向行业落地的2026年,营销领域正成为这场变...
全民皆兵!伊朗民众学习如何使用... 据凤凰卫视报道,在伊朗首都德黑兰的市中心,民众聚集在一名伊朗伊斯兰革命卫队士兵周围,学习使用突击步枪...
万斯:美伊谈判取得“很大进展” △5月19日,美国副总统万斯在白宫新闻简报会上当地时间5月19日,美国副总统万斯在白宫新闻简报会上表...
全环境立德树人|广饶县:“科普... 近日,一场别开生面的 “科普漂流”活动在东营市科技馆火热启程。来自广饶县的40余名青少年走出课堂,在...