使用命令$ brew info zookeeper
檢視可用版本資訊:
直接使用brew安裝zookeeper
安裝完成之後進入
配置/usr/local/etc/zookeeper目錄下面的zoo.cfg
進入vim zoo.cfgever:~ zhangsf$ cd /usr/local/etc/zookeeper/
ever:zookeeper zhangsf$ ls
defaults log4j.properties zoo.cfg zoo.cfg.bak zoo_sample.cfg
引數詳解:-clientport: 客戶端連線server的埠,即對外服務埠,一般設定為2181吧。1 # the number of milliseconds of each tick
2 ticktime=2000
3 # the number of ticks that the initial
4 # synchronization phase can take
5 initlimit=10
6 # the number of ticks that can pass between
7 # sending a request and getting an acknowledgement
8 synclimit=5
9 # 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/data
13 datalogdir=/users/zhangsf/data/zookeeper/logs
14 # the port at which the clients will connect
15 clientport=2181
16 # the maximum number of client connections.
17 # increase this if you need to handle more clients
18 #maxclientcnxns=60
19 #
20 # be sure to read the maintenance section of the
21 # administrator guide before turning on autopurge.
22 #
23 #
24 #
25 # the number of snapshots to retain in datadir
26 #autopurge.snapretaincount=3
27 # purge task interval in hours
28 # set to "0" to disable auto purge feature
29 #autopurge.purgeinterval=1
30 server.1=127.0.0.1:2888:3888
使用命令zkserver
,結果啟動失敗
接下來使用ever:zookeeper zhangsf$ zkserver
zookeeper jmx enabled by default
using config: /usr/local/etc/zookeeper/zoo.cfg
usage: ./zkserver.sh
zkserver start
:
可見啟動成功,並且使用了ever:zookeeper zhangsf$ zkserver start
zookeeper jmx enabled by default
using config: /usr/local/etc/zookeeper/zoo.cfg
starting zookeeper ... started
/usr/local/etc/zookeeper/
下的配置檔案zoo.cfg
執行命令zkcli
,輸出
隨便輸入ever:zookeeper zhangsf$ zkcli
connecting to localhost:2181
welcome to zookeeper!
jline support is enabled
watcher::
watchedevent state:syncconnected type:none path:null
ls
,然後終端變成了
其實這是jline互動控制台,會開啟乙個和zookeeper伺服器之間的session.connecting to localhost:2181
welcome to zookeeper!
jline support is enabled
watcher::
watchedevent state:syncconnected type:none path:null
[zk: localhost:2181(connected) 0] ls
[zk: localhost:2181(connected) 1] ls
[zk: localhost:2181(connected) 2]
可以通過執行quit命令,即[zk: localhost:2181(connected) 2] quit
退出互動控制台.
執行[zk: localhost:2181(connected) 0] ls
[zk: localhost:2181(connected) 1] ls
[zk: localhost:2181(connected) 2] quit
quitting...
ever:zookeeper zhangsf$
zkserver status
這裡的mode為standalone指的是單機模式ever:zookeeper zhangsf$ zkserver status
zookeeper jmx enabled by default
using config: /usr/local/etc/zookeeper/zoo.cfg
mode: standalone
ever:zookeeper zhangsf$
執行zkserver stop
ever:zookeeper zhangsf$ zkserver stop
zookeeper jmx enabled by default
using config: /usr/local/etc/zoo
mac 中使用docker安裝Zookeeper
首先去 docker 官網找zk映象 1 尋找映象 或者docker run privileged true id name zookeeper publish 2181 2181 id zookeeper latest 引數介紹 p 埠對映 name 容器例項名稱 d 後台執行 2181 zook...
Linux安裝Kafka 依賴zookeeper
一 版本 kafka kafka 2.12 2.4.0 zk zookeeper 3.4.14 二 單機版安裝 server.properties 建立日誌資料夾 修改kafka配置檔案 vim config server.properties listeners plaintext 本機ip 90...
mac 10 14 Qt程式發布的整理
1 10.14加入了攝像頭和麥克風授權的機制,可能會出現在時候攝像頭和麥克風時的crash 最新公升級到10.14.5後,基於obs的程式用到麥克風後攝像頭,在開啟攝像的時候crash,這個應該是系統沒有授權攝像頭許可權導致的,需要我們在應用的plist檔案裡增加許可權請求列表 nsmicropho...