博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zookeeper分布式部署(windows)
阅读量:5743 次
发布时间:2019-06-18

本文共 3525 字,大约阅读时间需要 11 分钟。

  hot3.png

zookeeper的cluster最少要三个节点:

       建立三个配置文件: 主要是dataDir, clientPort不一样

configs/zoo1.conf

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=datas/data1/# the port at which the clients will connectclientPort=2181# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1server.1=127.0.0.1:2888:3888server.2=127.0.0.1:4888:5888server.3=127.0.0.1:6888:7888

 configs/zoo2.conf

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=datas/data2/# the port at which the clients will connectclientPort=2182# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1server.1=127.0.0.1:2888:3888server.2=127.0.0.1:4888:5888server.3=127.0.0.1:6888:7888

 configs/zoo3.conf

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=datas/data3/# the port at which the clients will connectclientPort=2183# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1server.1=127.0.0.1:2888:3888server.2=127.0.0.1:4888:5888server.3=127.0.0.1:6888:7888

启动命令:

   在zookeeper根目录执行

java -cp .;zookeeper-3.4.8.jar;lib/*  org.apache.zookeeper.server.quorum.QuorumPeerMain configs/zoo1.conf
java -cp .;zookeeper-3.4.8.jar;lib/*  org.apache.zookeeper.server.quorum.QuorumPeerMain configs/zoo2.conf
java -cp .;zookeeper-3.4.8.jar;lib/*  org.apache.zookeeper.server.quorum.QuorumPeerMain configs/zoo3.conf

 

PS:  mac上的 启动命令  ;替换成 :

创建datas/data1   datas/data2   datas/data3目录 ,并在三个目录中放置myid文件,内容分别为1  2  3

转载于:https://my.oschina.net/u/1778261/blog/720936

你可能感兴趣的文章
spring.net 继承
查看>>
ES6:模块简单解释
查看>>
JavaScript indexOf() 方法
查看>>
用Bootstrap写一份简历
查看>>
ZJU PAT 1023
查看>>
WMI远程访问问题解决方法
查看>>
从零开始学习IOS,(UILabel控件)详细使用和特殊效果
查看>>
Android开发历程_15(AppWidget的使用)
查看>>
阿花宝宝 Java 笔记 之 初识java
查看>>
7、设计模式-创建型模式-建造者模式
查看>>
Cesium官方教程11--建模人员必读
查看>>
我国古代的勾股定理
查看>>
Linux下的C编程实战
查看>>
[32期] html中部分代码与英语单词关系
查看>>
PHP安装环境,服务器不支持curl_exec的解决办法
查看>>
jQuery|元素遍历
查看>>
RedHat 6 安装配置Apache 2.2
查看>>
Openstack 安装部署指南翻译系列 之 Manila服务安装(Share Storage)
查看>>
underscore.js学习笔记
查看>>
windows下常用命令
查看>>