Linux 环境zookeeper HA配置注意事项

来源:互联网 发布:淘宝steam充值卡知乎 编辑:程序博客网 时间:2024/05/20 10:10

作者根据实际经验总结的以下几点:

背景环境

Linux操作系统 red hat 5.3(一台独立的物理机上没有配置成功)

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=/usr/zookeeper-3.4.6/conf/data
# the port at which the clients will connect
clientPort=2181
server.1=10.201.7.158:2888:3888
server.2=10.201.7.157:2888:3888
server.3=10.201.7.139:2888:3888
# 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=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
autopurge.purgeInterval=1


注意事项:

1. 单点实例3个节点以上

2. jdk 1.7以上
3. Linux关闭SELinux ,防火墙开启相应的端口(2888,3888)
0 0