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

    3.4 linux 安装zookeeper

    下载zookeeper安装包

    https://downloads.apache.org/zookeeper/zookeeper-3.5.9/

     

    上传zookeeper 的安装包到Linux 服务器上面

     # 上传到 /myapp  下
     /myapp

     

    解压apache-zookeeper-3.5.9-bin.tar.gz

      tar -zxvf apache-zookeeper-3.5.9-bin.tar.gz 

     

    把解压后的文件移动到指定位置, 这里统一移动到 /myapp/software 目录下

      mv apache-zookeeper-3.5.9-bin /myapp/software/

     

    在 /data 目录下创建一个文件夹 zookeeper 用来存放zookeeper 的数据文件

     cd /data
     mkdir zookeeper

     

    复制cp zoo_sample.cfg zoo.cfg

     #进入 /myapp/software/apache-zookeeper-3.5.9-bin/conf 目录
     cd /myapp/software/apache-zookeeper-3.5.9-bin/conf
     # 复制 zoo_sample.cfg 文件,并重命名为zoo.cfg 否则zookeeper不会生效
     cp zoo_sample.cfg zoo.cfg

     

    编辑 zoo.cfg 文件,

    修改 dataDir 属性等于 /tmp/zookeeper 如下第13行所示

     # 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.
     # 主要是这里<>
     dataDir=/tmp/zookeeper
     # the port at which the clients will connect
     clientPort=2181
     # 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
     

     

    启动/关闭/查看状态 zookeeper 服务

     # 1.进入zookeeper安装目录的bin 目录
     /myapp/software/apache-zookeeper-3.5.9-bin/bin
     # 2. 启动zookeeper
     ./zkServer.sh start
     # 3. 关闭zookeeper
     ./zkServer.sh stop
     # 4. 查看zookeeper的状态
     ./zkServer.sh status

     

    阳光总在风雨后!
  • 相关阅读:
    微服务网关常用限流算法
    微服务网关zuul介绍
    Nginx实现微服务网关的简单介绍
    11.9-编写操作者
    11.5-编写程序
    11.3-学习操作者文档
    11.2-LV面向对象编程视频学习及周五与老师交流总结
    10.29-基于LabVIEW的分布式集群机器人控制系统
    10.27-运用操作者框架架设控制中心软件架构
    5.24-29离线解析问题
  • 原文地址:https://www.cnblogs.com/wanglichaoya/p/15499389.html
Copyright © 2011-2022 走看看