zookeeper01配置文件内容:
文件目录:zookeeper01/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/Users/zhangsan/Documents/zookeeper01/data
dataLogDir=/Users/zhangsan/Documents/zookeeper01/logs
clientPort=2181
server.1=127.0.0.1:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883
zookeeper02配置文件内容:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/Users/xusijun/Documents/zookeeper02/data
dataLogDir=/Users/xusijun/Documents/zookeeper02/logs
clientPort=2182
server.1=127.0.0.1:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883
zookeeper03配置文件内容:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/Users/xusijun/Documents/zookeeper03/data
dataLogDir=/Users/xusijun/Documents/zookeeper03/logs
clientPort=2183
server.1=127.0.0.1:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883
注意:
经过集群的测试得出:
1、位于不同网段的zookeeper无法搭建集群。