zoukankan      html  css  js  c++  java
  • linux下安装zookeeper

    1、下载zookeeper的安装包
      wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz

    2、解压压缩包
      tar zxvf zookeeper-3.3.6.tar.gz

    3、在zookeeper的跟目录下创建两个文件夹data和datalog

      这两个路径主要是用来存放zk的数据以及日志的(待会需要手动在配置文件中设置)

      在data目录下创建一个myid的文件,里面的值可以给个任意的值,主要用于集群中区分某个势力
       

    4、将入zookeeper的conf目录下,复制zoo_sample.cfg文件并自定义配置

      cp zoo_sample.cfg zoo.cfg

      vi 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.
    dataDir=/www/websoft/zookeeper-3.3.6/data
    dataLogDir=/www/websoft/zookeeper-3.3.6/datalog
    # the port at which the clients will connect
    clientPort=2181
    server.100=192.168.1.21:2888:3888

    这里只是配置了一个单机的zookeeper,需要配置成集群的话只要在最后面加上其他服务器的ip和端口就行了(类似server.100=192.168.1.21:2888:3888

    5、启动zookeeper

      cd /www/websoft/zookeeper-3.3.6

      bin/zkServer.sh start &

     zk启动后查看zk的启动情况
    bin/zkServer.sh status

    当出现这种信息就说明你的zk已经安装成功了

  • 相关阅读:
    园子一周年
    HTML5本地存储之Web Storage实例篇,最有用的是localStorage
    解析H5本地储存Web Storage
    response.sendRedirect传递参数和转向
    html文件form表单action调用servlet连接mysql数据库实例
    容器List之ArrayList详解
    PageHelper的使用
    可迭代对象、迭代器、生成器
    伪随机数生成器——random模块的用法
    python中的单例设计模式
  • 原文地址:https://www.cnblogs.com/gulang-jx/p/7423564.html
Copyright © 2011-2022 走看看