Zookeeper 部署之(单机)伪集群部署

  1. 下载zookeeper-3.3.6
  2. 粘贴复制一份命名为:zookeeper-3.3.6node1  zookeeper-3.3.6node2
  3. 修改node1  node2 的conf文件夹中zoo.cfg 配置文件 以下:
  4. node1 conf
  5. # 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日志

  6. node2 confserver

  7. # 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

  8. 须要手动建立配置文件中  数据存放路径文件夹 data  以及 数据日志存放文件夹logs  而且须要在data文件下建立一个 myid的文件  内容 和server.1  后面的数字保持一致。it

  9. 以上配置完成以后  便可启动zookeeper ,第一个node启动 会报错是正常状况  吧全部节点zk启动成功以后 便可。。io

  10. 可以使用jps 命令去查询   此时部署便可成功  可自行将dubbo接入。。集群

相关文章
相关标签/搜索