macOS中安装Zookeeper(单机)

2019-04-12

使用 Homebrew

Check

  ~ brew info zookeeper
zookeeper: stable 3.4.13 (bottled), HEAD
Centralized server for distributed coordination of services
https://zookeeper.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zookeeper.rb
==> Options
--HEAD
	Install HEAD version
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don't want/need a background service you can just run:
  zkServer start
==> Analytics
install: 5,115 (30 days), 14,310 (90 days), 57,644 (365 days)
install_on_request: 1,644 (30 days), 4,326 (90 days), 19,536 (365 days)
build_error: 0 (30 days)

Not installed

Install

  ~ brew install zookeeper
Updating Homebrew...
^C==> Downloading https://homebrew.bintray.com/bottles/zookeeper-3.4.13.high_sierr
######################################################################## 100.0%
==> Pouring zookeeper-3.4.13.high_sierra.bottle.tar.gz
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don't want/need a background service you can just run:
  zkServer start
==> Summary
  /usr/local/Cellar/zookeeper/3.4.13: 244 files, 33.4MB
==> `brew cleanup` has not been run in 30 days, running now...

Config

  ~ cat /usr/local/etc/zookeeper/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/var/run/zookeeper/data
# 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

Start

  ~ zkServer start
\ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Starting zookeeper ... STARTED
  ~ zkServer status
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Mode: standalone
Usage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}

GUI Client

https://issues.apache.org/jira/secure/attachment/12436620/ZooInspector.zip

image.png