zoukankan      html  css  js  c++  java
  • mac下zookeeper安装配置及启动

    安装:

    zookeeper支持brew安装。

    $brew info zookeeper
    zookeeper: stable 3.4.6 (bottled), HEAD
    Centralized server for distributed coordination of services
    https://zookeeper.apache.org/
    /usr/local/Cellar/zookeeper/3.4.6_1 (208 files, 13M) *
      Poured from bottle
    From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zookeeper.rb
    ==> Options
    --with-perl
        Build Perl bindings
    --with-python
        Build with python support
    --HEAD
        Install HEAD version
    ==> Caveats
    To have launchd start zookeeper at login:
      ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgents
    Then to load zookeeper now:
      launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plist
    Or, if you don't
    

      

    $brew install zookeeper
    ==> Downloading https://homebrew.bintray.com/bottles/zookeeper-3.4.6_1.mavericks.bottle.2.tar.gz
    ######################################################################## 100.0%
    ==> Pouring zookeeper-3.4.6_1.mavericks.bottle.2.tar.gz
    ==> Caveats
    To have launchd start zookeeper at login:
      ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgents
    Then to load zookeeper now:
      launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plist
    Or, if you don't want/need launchctl, you can just run:
      zkServer start
    ==> Summary
    ��  /usr/local/Cellar/zookeeper/3.4.6_1: 207 files, 13M
    

      

    安装后,在/usr/local/etc/zookeeper/目录下,已经有了缺省的配置文件。

    ls /usr/local/etc/zookeeper
    defaults        log4j.properties    zoo.cfg         zoo_sample.cfg
    

      

    启动服务

    $zkServer 
    JMX enabled by default
    Using config: /usr/local/etc/zookeeper/zoo.cfg
    Usage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
    
    $ zkServer  status
    JMX enabled by default
    Using config: /usr/local/etc/zookeeper/zoo.cfg
    Error contacting service. It is probably not running.
    
    $ zkServer  start
    JMX enabled by default
    Using config: /usr/local/etc/zookeeper/zoo.cfg
    Starting zookeeper ... STARTED
    

      

    查看zookeeper运行及状态

    安装后,可以看到zookeeper提供了zkCli等工具进行.

    $zkCli
    Connecting to localhost:2181
    
    Welcome to ZooKeeper!
    JLine support is enabled
    [zk: localhost:2181(CONNECTING) 0] 
    [zk: localhost:2181(CONNECTING) 0] 
    WATCHER::
    
    WatchedEvent state:SyncConnected type:None path:null
    
    [zk: localhost:2181(CONNECTED) 0] ls
    [zk: localhost:2181(CONNECTED) 1] ls /
    [zookeeper]
    [zk: localhost:2181(CONNECTED) 2] ls /zookeeper
    [quota]
    [zk: localhost:2181(CONNECTED) 3] ls /zookeeper/quota
    []
    [zk: localhost:2181(CONNECTED) 4] 
    

      转载自:https://blog.csdn.net/whereismatrix/article/details/50420099

    
    
    
    
    
    
  • 相关阅读:
    JAVA | Guava EventBus 使用 发布/订阅模式
    Go | Go 语言打包静态文件以及如何与Gin一起使用Go-bindata
    写了一个慢接口,年终妥妥的325
    理解C#中的ExecutionContext vs SynchronizationContext
    理解C#中的ConfigureAwait
    反直觉的三门问题
    连求最大公约数都不会,我怕不是上了个假大学
    「补课」进行时:设计模式(22)——桥梁模式
    抄答案就是了,两套详细的设计方案,解决头疼的支付掉单问题
    如何写好绩效考核中的年终总结?
  • 原文地址:https://www.cnblogs.com/xczssl/p/8682388.html
Copyright © 2011-2022 走看看