# 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接入。。集羣