macOS中安装Zookeeper(单机)

使用 Homebrew

Check

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  ~ 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

1
2
3
4
5
6
7
8
9
10
11
12
13
➜  ~ 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
➜  ~ 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

1
2
3
4
5
6
7
8
➜  ~ 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
1
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

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×