赞
踩
tickTime=2000
dataDir=/usr/local/zk/data
dataLogDir=/usr/local/zk/dataLog
clientPort=2181
export ZOOKEEPER_HOME=/usr/local/zk
export PATH=.:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$JAVA_HOME/bin:$PATH
# 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.
dataDir=/usr/local/zk/data_1
# the port at which the clients will connect
clientPort=2181
#the location of the log file
dataLogDir=/usr/local/zk/logs_1
server.0=localhost:2287:3387
server.1=localhost:2288:3388
server.2=localhost:2289:3389
# 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.
dataDir=/usr/local/zk/data_2
# the port at which the clients will connect
clientPort=2182
#the location of the log file
dataLogDir=/usr/local/zk/logs_2
server.0=localhost:2287:3387
server.1=localhost:2288:3388
server.2=localhost:2289:3389
# 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.
dataDir=/usr/local/zk/data_3
# the port at which the clients will connect
clientPort=2183
#the location of the log file
dataLogDir=/usr/local/zk/logs_3
server.0=localhost:2287:3387
server.1=localhost:2288:3388
server.2=localhost:2289:3389
zkServer.sh start zoo1.sh
zkServer.sh start zoo2.sh
zkServer.sh start zoo3.sh
zkServer.sh status zoo1.cfg
zkServer.sh status zoo2.cfg
zkServer.sh status zoo3.cfg
Server0机器的内容为:0
Server1机器的内容为:1
Server2机器的内容为:2
## 在conf目录下删除zoo_sample.cfg文件,创建一个配置文件zoo.cfg,如下所示,代码清单 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.
dataDir=/usr/local/zk/data
# the port at which the clients will connect
clientPort=2183
#the location of the log file
dataLogDir=/usr/local/zk/log
server.0=hadoop:2288:3388
server.1=hadoop0:2288:3388
server.2=hadoop1:2288:3388
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。