搭建zookper伪集群

第一步:

复制3份zookeeper命名为:zookeeper-3.3.6_N1、zookeeper-3.3.6_N2、zookeeper-3.3.6_N3

第二步:

修改N1配置文件:

# 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=/data/zookeeper/node1/data

dataLogDir=/data/zookeeper/node1/logs

# the port at which the clients will connect

clientPort=2181

server.0=192.168.174.128:2887:3887

server.1=192.168.174.128:2888:3888

server.2=192.168.174.128:2889:3889

备注:在
/data/zookeeper/node1/data 目录下创建 myid文件 ,并将0保存文件中

第三步:

修改N2配置文件:

# 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=/data/zookeeper/node2/data

dataLogDir=/data/zookeeper/node2/logs

# the port at which the clients will connect

clientPort=2182

server.0=192.168.174.128:2887:3887

server.1=192.168.174.128:2888:3888

server.2=192.168.174.128:2889:3889

备注:在
/data/zookeeper/node2/data 目录下创建 myid文件 ,并将1保存文件中

第四步:

修改NODE3配置文件:

# 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=/data/zookeeper/node3/data

dataLogDir=/data/zookeeper/node3/logs

# the port at which the clients will connect

clientPort=2183

server.0=192.168.174.128:2887:3887

server.1=192.168.174.128:2888:3888

server.2=192.168.174.128:2889:3889

备注:在
/data/zookeeper/node2/data 目录下创建 myid文件 ,并将2保存文件中

第五步:

启动3个zookeeper服务即可。

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2018年8月10日
下一篇 2018年8月10日

相关推荐