配置文件 /.../zookeeper/conf/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=/var/zookeeper
# the port at which the clients will connect
clientPort=2181
server.1=hadoopM:2888:3888
server.2=hadoopS1:2888:3888
server.3=hadoopS2:2888:3888
启动Zookeeper,要逐个节点启动
/.../zookeeper/bin/zkServer.sh start
报错:Invalid config, exiting abnormally
配置文件 /conf/zoo.cfg 中 dataDir 指定myid 文件位置
myid 中第一行必须存 节点序号(数字)
否则无法正常启动。
网友评论