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

    1、安装JDK 

      参考JDK安装及环境变量配置:https://www.cnblogs.com/xiaoliangup/p/9617206.html

    2、安装Zookeeper

    2.1、下载zookeeper

    网址 https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/ 

    wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz

       2.2、解压

       2.3、移动到指定位置并改名为zookeeper

      

      

      2.4 开机启动zookeeper
    #!/bin/bash
    #chkconfig:2345 20 90
    #description:zookeeper
    #processname:zookeeper
    ZK_PATH=/usr/local/zookeeper
    export JAVA_HOME=/usr/local/java/jdk1.8.0_171
    case $1 in
             start) sh  $ZK_PATH/bin/zkServer.sh start;;
             stop)  sh  $ZK_PATH/bin/zkServer.sh stop;;
             status) sh  $ZK_PATH/bin/zkServer.sh status;;
             restart) sh $ZK_PATH/bin/zkServer.sh restart;;
             *)  echo "require start|stop|status|restart"  ;;
    esac

    把脚本注册为Service

      增加权限

      

      2.5 配置zookeeper

      拷贝/usr/local/zookeeper/conf/zoo_sample.cfg   到同一个目录下改个名字叫zoo.cfg

      

      修改zoo.cfg,并创建data、datalog文件夹

    # 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=/opt/module/zookeeper-3.4.11/data
    dataLogDir=/opt/module/zookeeper-3.4.11/datalog
    # 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
    2.6 启动zookeeper

      启动指令:service zookeeper start

      查看指令:service zookeeper status

  • 相关阅读:
    CSS布局之浮动原理
    img中的alt和title的区别
    重绘+重排+项目优化
    事件冒泡、事件捕获和事件委托
    js数组方法总结
    flex布局
    冒泡排序
    函数节流和函数防抖
    从一个url地址最终到页面渲染完成,发生了什么
    如何让网站变灰
  • 原文地址:https://www.cnblogs.com/xiaoliangup/p/10582346.html
Copyright © 2011-2022 走看看