日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

在mac OSX中安装启动zookeeper

發(fā)布時(shí)間:2023/12/15 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在mac OSX中安装启动zookeeper 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

安裝

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-perlBuild Perl bindings --with-pythonBuild with python support --HEADInstall 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 want/need launchctl, you can just run:zkServer start

安裝

$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/目錄下,已經(jīng)有了缺省的配置文件。

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

缺省配置[/usr/local/etc/zookeeper/zoo.cfg] 內(nèi)容如下

$less -N /usr/local/etc/zookeeper/zoo.cfg 1 # The number of milliseconds of each tick2 tickTime=20003 # The number of ticks that the initial 4 # synchronization phase can take5 initLimit=106 # The number of ticks that can pass between 7 # sending a request and getting an acknowledgement8 syncLimit=59 # the directory where the snapshot is stored.10 # do not use /tmp for storage, /tmp here is just 11 # example sakes.12 dataDir=/usr/local/var/run/zookeeper/data13 # the port at which the clients will connect14 clientPort=218115 # the maximum number of client connections.16 # increase this if you need to handle more clients17 #maxClientCnxns=6018 #19 # Be sure to read the maintenance section of the 20 # administrator guide before turning on autopurge.21 #22 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance23 #24 # The number of snapshots to retain in dataDir25 #autopurge.snapRetainCount=326 # Purge task interval in hours27 # Set to "0" to disable auto purge feature28 #autopurge.purgeInterval=1

啟動(dòng)服務(wù)

執(zhí)行命令zkServer

$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運(yùn)行及狀態(tài)

安裝后,可以看到zookeeper提供了zkCli等工具進(jìn)行.

$zkCli Connecting to localhost:2181Welcome 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]

總結(jié)

以上是生活随笔為你收集整理的在mac OSX中安装启动zookeeper的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。