ZooKeeper的安装
?
安装ZooKeeper时看到的一片文章,感觉挺好的,拿来分享一下。
?
?
ZooKeeper的安装模式分为三种,分别为:单机模式(stand-alone)、集群模式和集群伪分布模式。ZooKeeper 单机模式的安装相对比较简单,如果第一次接触ZooKeeper的话,建议安装ZooKeeper单机模式或者集群伪分布模式。
?
1)单机模式
?
zoo3.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=/root/hadoop-0.20.2/zookeeper-3.3.1/d_2
?
# the port at which the clients will connect
clientPort=2183
?
#the location of the log file
dataLogDir=/root/hadoop-0.20.2/zookeeper-3.3.1/logs
?
server.1=localhost:2887:3887?
server.2=localhost:2888:3888
server.3=localhost:2889:3889
?
从上述三个代码清单中可以看到,除了?clientPort?不同之外,?dataDir?也不同。另外,不要忘记在?dataDir?所对应的目录中创建?myid?文件来指定对应的?zookeeper?服务器实例。
?