zoukankan      html  css  js  c++  java
  • zk创建集群

    在单机环境下和创建集群。

    需要注意的点:

    • 配置数据文件myid 1/2/3 对应server.1/2/3
    • 通过./zkCli.sh -server [ip]:[port]  检测集群是否创建成功

    在zoo.cfg配置文件下最下方写上

    # 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.
    # do not use /tmp for storage, /tmp here is just 
    # example sakes.
    dataLogDir=/usr/local/zookeeper01/logs      ############需要重新设置下,日志存放的地方
    dataDir=/usr/local/zookeeper01/data         ############需要重新设置下,数据存放的地方
    # the port at which the clients will connect
    clientPort=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=1
    server.1=localhost:2287:3387
    server.2=localhost:2288:3388
    server.3=localhost:2289:3389

    但是注意,这个配置文件上面的   dataDir= /usr/local/zookeeper01/data 

    然后我们到dataDir对应的目录去创建一个myid的文件  内容是1

    其他两个依次类推。

    然后重启zkServer.sh restart    

  • 相关阅读:
    【刷题】HDU 6183 Color it
    【刷题】HDU 3435 A new Graph Game
    【刷题】HDU 1853 Cyclic Tour
    【刷题】BZOJ 5418 [Noi2018]屠龙勇士
    【刷题】BZOJ 5415 [Noi2018]归程
    【刷题】BZOJ 4636 蒟蒻的数列
    【刷题】BZOJ 4443 [Scoi2015]小凸玩矩阵
    vue_过滤器: 对要显示的数据进行特定格式化后再显示
    vue_过渡_动画
    vue_实例_组件的生命周期
  • 原文地址:https://www.cnblogs.com/coder-lzh/p/9503307.html
Copyright © 2011-2022 走看看