1. 程式人生 > >zookeeper 常用命令及znode簡介

zookeeper 常用命令及znode簡介

ntc time err client sessionid cli init 運行 server

1. 進入zookeeper 安裝目錄下的bin目錄, 運行腳本, ip + clientPort (這裏註意, clientPort是在zoo.cfg文件裏邊的一個配置, 而不是 server.1=168.72.230.27:2888:3888 這種server配置裏邊的端口)

./zkCli.sh -server 168.72.230.27:2181

Welcome to ZooKeeper!
2018-08-19 23:50:08,320 [myid:] - INFO [main-SendThread(168.72.230.27:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 168.72.230.27/168.72.230.27:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2018-08-19 23:50:08,412 [myid:] - INFO [main-SendThread(168.72.230.27:2181):ClientCnxn$SendThread@876] - Socket connection established to 168.72.230.27/168.72.230.27:2181, initiating session
2018-08-19 23:50:08,423 [myid:] - INFO [main-SendThread(168.72.230.27:2181):ClientCnxn$SendThread@1299] - Session establishment complete on server 168.72.230.27/168.72.230.27:2181, sessionid = 0x16545f46d6f0028, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: 168.72.230.27:2181(CONNECTED) 0]

2.

zookeeper 常用命令及znode簡介