zoukankan      html  css  js  c++  java
  • MAC安装单机zookeeper

    下载

    cd /usr/local/software
    sudo wget https://downloads.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz

    解压

    sudo tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz
    sudo mv apache-zookeeper-3.7.0-bin/ zookeeper

    创建data和log文件

    # 在 /usr/local/software/zookeeper 目录下新建两个文件夹 data 和 log,用于存储zookeeper的数据和日志。
    sudo mkdir data
    sudo mkdir log

    改配置

    # 将conf目录下的zoo_sample.cfg文件更名为zoo.cfg,简单修改配置文件,自定义设置数据文件目录和日志文件目录
    sudo mv 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.
    # do not use /tmp for storage, /tmp here is just
    # example sakes.
    dataDir=/usr/local/software/zookeeper/data
    dataLogDir=/usr/local/software/zookeeper/log
    # 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
    
    ## Metrics Providers
    #
    # https://prometheus.io Metrics Exporter
    #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
    #metricsProvider.httpPort=7000
    #metricsProvider.exportJvmInfo=true

    启动server

    cd /usr/local/software/zookeeper/bin
    sudo ./zkServer.sh start

    连接client

    cd /usr/local/software/zookeeper/bin
    ./zkCli.sh -server 127.0.0.1:2181

    结束!

  • 相关阅读:
    【noip2011】选择客栈
    【noip2013】货车运输
    【bzoj3732】Network
    Codeforces 111C Petya and Spiders (状压dp)
    线段树优化 dijkstra (CF787D Legacy)
    Codeforces 908G Yet Another Maxflow Problem (最小割定理,线段树)
    IOI 2007 Sail (线段树+贪心)
    Codeforces 474E Pillars (树状数组+dp)
    Bzoj 3688 折线统计(dp+树状数组)
    Gorgeous Sequence (线段树)
  • 原文地址:https://www.cnblogs.com/aaronthon/p/15602030.html
Copyright © 2011-2022 走看看