cd /usr/local mkdir -p zookeeper/data cd zookeeper # 选择最新稳定版本 wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz tar zxvf zookeeper-3.4.14.tar.gz
[root@zk-1 bin]# zkServer.sh status ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/zookeeper-3.4.14/bin/../conf/zoo.cfg Mode: standalone
[root@zk-1 bin]# zkCli.sh -server localhost:2181 Connecting to localhost:2181 …… using SASL (unknown error) Welcome to ZooKeeper! JLine support is enabled 2019-06-30 09:42:49,112 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@879] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session 2019-06-30 09:42:49,168 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1303] - Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x100002654ed0000, negotiated timeout = 30000 WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0]
集群部署
1 2 3 4 5 6
cd /usr/local mkdir -p zookeeper/data cd zookeeper # 选择最新稳定版本 wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz tar zxvf zookeeper-3.4.14.tar.gz