# 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=D:\\var\\zookeeper02\\datanode
dataLogDir=D:\\var\\zookeeper02\\logs
# the port at which the clients will connect
clientPort=2182服务器
server.1=localhost:2887:3887
server.2=localhost:2888:3888日志
node2 confserver
# 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=D:\\var\\zookeeper01\\dataip
dataLogDir=D:\\var\\zookeeper01\\logs
# the port at which the clients will connect
clientPort=2181部署
server.1=localhost:2887:3887
server.2=localhost:2888:3888 A表示这个是第几号服务器,B 是这个服务器的 ip 地址;C 表示的是这个服务器与集群中的 Leader 服务器交换信息的端口 D 表示的是万一集群中的 Leader 服务器挂了,须要一个端口来从新进行选举,选出一个新的Leaderget
须要手动建立配置文件中 数据存放路径文件夹 data 以及 数据日志存放文件夹logs 而且须要在data文件下建立一个 myid的文件 内容 和server.1 后面的数字保持一致。it
以上配置完成以后 便可启动zookeeper ,第一个node启动 会报错是正常状况 吧全部节点zk启动成功以后 便可。。io
可以使用jps 命令去查询 此时部署便可成功 可自行将dubbo接入。。集群