博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转]ZooKeeper 集群环境搭建 (本机3个节点)
阅读量:6514 次
发布时间:2019-06-24

本文共 3781 字,大约阅读时间需要 12 分钟。

是一个简单的分布式同步数据库(或者是小文件系统)

--------------------------------------------------------

1、建立目录
server1
server1/dataDir
server1/dataLogDir
server1/logs
server1/zookeeper3.4.6

server2

server2/dataDir
server2/dataLogDir
server2/logs
server2/zookeeper3.4.6

server3

server3/dataDir
server3/dataLogDir
server3/logs
server3/zookeeper3.4.6

-------------------------------------------------------

2、myid

server1/dataDir/myid

1

server2/dataDir/myid

2

server3/dataDir/myid

3

--------------------------------------------------------

3、zoo.cfg

server1/dataDir/zookeeper3.4.6/conf/zoo.cfg

tickTime=2000

initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server1/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server1/dataLogDir
clientPort=2181
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889

server2/dataDir/zookeeper3.4.6/conf/zoo.cfg

tickTime=2000

initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server2/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server2/dataLogDir
clientPort=2182
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889

server3/dataDir/zookeeper3.4.6/conf/zoo.cfg

tickTime=2000

initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server3/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server3/dataLogDir
clientPort=2183
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889

--------------------------------------------------------

3、log4j.properties

server1/dataDir/zookeeper3.4.6/conf/log4j.properties

# Define some default values that can be overridden by system properties

zookeeper.root.logger=INFO, CONSOLE
zookeeper.console.threshold=INFO
zookeeper.log.dir=D:/Tools/zookeeper3.4.6/server1/logs
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=DEBUG
zookeeper.tracelog.dir=D:/Tools/zookeeper3.4.6/server1/logs
zookeeper.tracelog.file=zookeeper_trace.log

#

# ZooKeeper Logging Configuration
#

# Format is "<default threshold> (, <appender>)+

# DEFAULT: console appender only

log4j.rootLogger=${zookeeper.root.logger}

# Example with rolling log file

#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE

# Example with rolling log file and tracing

#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE

#

# Log INFO level and above messages to the console
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#

# Add ROLLINGFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}

# Max log file size of 10MB

log4j.appender.ROLLINGFILE.MaxFileSize=10MB
# uncomment the next line to limit number of backup files
#log4j.appender.ROLLINGFILE.MaxBackupIndex=10

log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout

log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#
# Add TRACEFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}

log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout

### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n

 

转载于:https://www.cnblogs.com/freebird92/p/6607083.html

你可能感兴趣的文章
追求绿色数据中心
查看>>
Web开发初学指南
查看>>
探寻光存储没落的真正原因
查看>>
高通64位ARMv8系列服务器芯片商标命名:Centriq
查看>>
中国人工智能学会通讯——融合经济学原理的个性化推荐 1.1 互联网经济系统的基本问题...
查看>>
戴尔为保护数据安全 推出新款服务器PowerEdge T30
查看>>
今年以来硅晶圆涨幅约达40%
查看>>
构建智能的新一代网络——专访Mellanox市场部副总裁 Gilad Shainer
查看>>
《数字视频和高清:算法和接口》一导读
查看>>
《中国人工智能学会通讯》——6.6 实体消歧技术研究
查看>>
如何在Windows查看端口占用情况及查杀进程
查看>>
云存储应用Upthere获7700万美元股权债务融资
查看>>
国家互联网应急中心何世平博士主题演讲
查看>>
洗茶,你误会了多少年?
查看>>
贵阳高新区力争打造“千亿级大数据园区”
查看>>
安防众筹不止于卖产品 思维拓展刺激消费
查看>>
OpenSSH曝高危漏洞 会泄露私钥
查看>>
艾特网能获2016APCA用户满意品牌大奖
查看>>
《CCNP TSHOOT 300-135学习指南》——第2章 结构化故障检测与排除进程
查看>>
《Java EE 7精粹》—— 2.5 非阻塞I/O
查看>>