网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

zookeeper清理日志-创新互联

一、描述

成都创新互联从2013年开始,先为袁州等服务建站,袁州等地企业,进行企业商务咨询服务。为袁州企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文名称:zookeeper清理日志-创新互联
本文路径:http://bjjierui.cn/article/cdgssi.html

其他资讯