Zookeeper学习二:zookeeper分布式安装
标签(空格分隔): zookeeper
1,修改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=/opt/app/zookeeper-3.4.5/data
# the port at which the clients will connect
clientPort=2181
#
# 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
server.1=hadoop001.com.cn:2888:3888
server.2=hadoop002.com.cn:2888:3888
server.3=hadoop003.com.cn:2888:3888
2,在各机器安装的数据目录下创建myid文件
touch myid
添加如下配置(不同的机器配置不一样)
1
3,将zookeeper目录拷贝到其它的目录下面
scp -r /opt/app/zookeeper-3.4.5 hadoop002.com.cn:/opt/app/
scp -r /opt/app/zookeeper-3.4.5 hadoop003.com.cn:/opt/app/
需要修改myid配置文件
4,启动服务集群
[hadoop001@hadoop001 zookeeper-3.4.5]$ bin/zkServer.sh start
[hadoop001@hadoop001 zookeeper-3.4.5]$ bin/zkServer.sh status