Installation
Zookeeper Support for brew installation
? ~ BrewInfozookeeperzookeeper:stable3.4.8(bottled), headcentralized server fordistributed coordination of Serviceshttps://zookeeper.apache.org/Not Installedfrom:https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git/formula/zookeeper.rb==>Options--with-PerlBuild Perl Bindings--with-python Build with Python support--Head Install head version==>Caveatsto has launchd start zookeeper now and restart atLogin: Brew Services start Zookeeperor,ifYou don'T want/need a background service you can just run:Zkserver start
Installation
? ~ BrewInstallZookeeper==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/zookeeper-3.4.8.el_capitan.bottle.tar.gz########################################################################100.0%==> Pouring zookeeper-3.4.8. El_capitan.bottle.Tar. GZ==>Caveatsto has launchd start zookeeper now and restart atLogin: Brew Services start Zookeeperor,ifYou don'T want/need a background service you can just run:zkserver Start==>Summary?? /usr/local/cellar/zookeeper/3.4.8:237Files17.6M
After installation, the /usr/local/etc/zookeeper/
default configuration file is already in the directory.
? ls /usr/local/etc/zookeeperdefaults log4j.properties zoo.cfg zoo_sample.cfg
The default configuration [/usr/local/etc/zookeeper/zoo.cfg] content is as follows
? /Cat/usr/local/etc/zookeeper/zoo.cfg# The number of milliseconds of each tickticktime= -# The number of ticks that the initial# synchronization phase can takeinitlimit=Ten# The number of ticks that can pass between# sending a request and getting an acknowledgementsynclimit=5# The directory where the snapshot is stored.# DoNot use/tmp forStorage,/tmp Here is just# example Sakes.datadir=/usr/local/var/run/zookeeper/data# the Port atwhichThe clients would connectclientport=2181# The maximum number of client connections.# increase thisifYou need to handle MoreClients#maxclientcnxns= -# # is sure to read the maintenance sections of the# Administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperadmin.html#sc_maintenance# # of snapshots to retaininchDatadir#autopurge.snapretaincount=3# Purge Task intervalinchhours# Set to"0"To disable Auto purge feature#autopurge.purgeinterval=1
Start the service
Execute zkserver command
? //usr/local/etc/zookeeper/zoo.cfgusage:. /zkserver. SH {start|start-foreground|stop|restart|status|upgrade|print-cmd}? //usr/local/etc/zookeeper/zoo.cfgerror contacting service. It is probably not running.? //usr/local/etc/zookeeper/zoo.cfgstarting zookeeper ... STARTED
View zookeeper operation and status
After installation, you can see that zookeeper provides tools such as ZKCLI.
? /zkcliconnecting to localhost:2181Welcome to ZooKeeper!jline support is enabled[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]
Ps:
http://blog.csdn.net/whereismatrix/article/details/50420099
Mac OSX Installation Boot zookeeper