zookeeper清理日志

本文涉及的产品
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
日志服务 SLS,月写入数据量 50GB 1个月
注册配置 MSE Nacos/ZooKeeper,118元/月
简介:

一、描述

    大早上刚到公司就发现报警,磁盘容量告警,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











本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1923375,如需转载请自行联系原作者
相关实践学习
基于MSE实现微服务的全链路灰度
通过本场景的实验操作,您将了解并实现在线业务的微服务全链路灰度能力。
目录
相关文章
|
3月前
|
存储 Linux Docker
centos系统清理docker日志文件
通过以上方法,可以有效清理和管理CentOS系统中的Docker日志文件,防止日志文件占用过多磁盘空间。选择合适的方法取决于具体的应用场景和需求,可以结合手动清理、logrotate和调整日志驱动等多种方式,确保系统的高效运行。
326 2
|
4月前
|
存储 消息中间件 大数据
大数据-70 Kafka 高级特性 物理存储 日志存储 日志清理: 日志删除与日志压缩
大数据-70 Kafka 高级特性 物理存储 日志存储 日志清理: 日志删除与日志压缩
71 1
|
4月前
|
SQL 存储 关系型数据库
Mysql主从同步 清理二进制日志的技巧
Mysql主从同步 清理二进制日志的技巧
49 1
|
6月前
|
SQL Oracle 关系型数据库
"揭秘!一键解锁Oracle日志清理魔法,让海量归档日志无处遁形,守护数据库健康,告别磁盘空间告急噩梦!"
【8月更文挑战第9天】随着Oracle数据库在企业应用中的普及,归档日志管理对保持数据库健康至关重要。归档日志记录所有更改,对数据恢复极为重要,但也可能迅速占用大量磁盘空间影响性能。利用Oracle提供的RMAN工具,可通过编写Shell脚本来自动清理归档日志。脚本包括设置环境变量、连接数据库、检查和删除指定时间前的日志,并记录执行情况。通过Cron作业定时运行脚本,可有效管理日志文件,确保数据库稳定运行。
163 7
|
6月前
|
SQL 关系型数据库 MySQL
MySQL 常见日志清理策略
MySQL 数据库服务器使用多种类型的日志来记录操作和事件,这对于故障诊断、审计和性能分析非常重要。然而,这些日志文件会随着时间的推移而不断增长,可能会占用大量的磁盘空间。因此,定期清理这些日志是必要的,本篇文章我们一起来学习下如何清理 MySQL 中的日志文件。
324 3
|
6月前
|
关系型数据库 MySQL
清理MySQL的binlog日志
清理MySQL的binlog日志
944 0
|
8月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode如何解决
【6月更文挑战第26天】zookeeper的日志报will be dropped if server is in r-o mode如何解决
337 2
|
8月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode
【6月更文挑战第8天】zookeeper的日志报will be dropped if server is in r-o mode
176 6
|
8月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode 问题
【6月更文挑战第13天】zookeeper的日志报will be dropped if server is in r-o mode 问题
286 1
|
3月前
|
XML 安全 Java
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板
本文介绍了Java日志框架的基本概念和使用方法,重点讨论了SLF4J、Log4j、Logback和Log4j2之间的关系及其性能对比。SLF4J作为一个日志抽象层,允许开发者使用统一的日志接口,而Log4j、Logback和Log4j2则是具体的日志实现框架。Log4j2在性能上优于Logback,推荐在新项目中使用。文章还详细说明了如何在Spring Boot项目中配置Log4j2和Logback,以及如何使用Lombok简化日志记录。最后,提供了一些日志配置的最佳实践,包括滚动日志、统一日志格式和提高日志性能的方法。
937 31
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板

热门文章

最新文章