注意:如果未初始化數(shù)據(jù)目錄,則無(wú)法啟動(dòng)ZooKeeper服務(wù)器。
//在生產(chǎn)環(huán)境中,您應(yīng)該將ZooKeeper部署為具有奇數(shù)個(gè)服務(wù)器的集合。只要集合中的大多數(shù)服務(wù)器可用,ZooKeeper服務(wù)就可用。建議的最小集合大小是三個(gè)ZooKeeper服務(wù)器,Cloudera建議每個(gè)服務(wù)器在單獨(dú)的計(jì)算機(jī)上運(yùn)行。此外,如果可能,ZooKeeper服務(wù)器進(jìn)程應(yīng)該有自己的專(zhuān)用磁盤(pán)存儲(chǔ)。
//查看zk的狀態(tài)
[root@hadoop-205-107 opt]# echo "stat" |nc 192.168.205.107 2181
Zookeeper version: 3.4.5-cdh6.9.2--1, built on 04/04/2017 08:43 GMT
Clients:
/192.168.205.107:35132[1](queued=0,recved=424,sent=424)
/192.168.205.107:45317[0](queued=0,recved=1,sent=0)
/192.168.205.107:35125[1](queued=0,recved=879,sent=879)
/192.168.205.107:35227[1](queued=0,recved=6576,sent=6576)
/192.168.205.107:35133[1](queued=0,recved=449,sent=449)
/192.168.205.107:35075[1](queued=0,recved=508,sent=510)
/192.168.205.107:35100[1](queued=0,recved=432,sent=432)
/192.168.205.107:35083[1](queued=0,recved=2404,sent=2441)
Latency min/avg/max: 0/0/231
Received: 15265
Sent: 15579
Connections: 8
Outstanding: 0
Zxid: 0x7fa
Mode: standalone
Node count: 44
[root@hadoop-205-107 opt]# echo "stat" |nc 192.168.205.107 2181|grep Mode
Mode: standalone
[root@hadoop-205-107 opt]# /opt/cloudera/parcels/CDH-5.9.2-1.cdh6.9.2.p0.3/lib/zookeeper/bin/zkServer.sh status
JMX enabled by default
Using config: /opt/cloudera/parcels/CDH-5.9.2-1.cdh6.9.2.p0.3/lib/zookeeper/bin/../conf/zoo.cfg
Mode: standalone
[root@hadoop-205-107 opt]# telnet 192.168.205.107 2181
Trying 192.168.205.107...
Connected to 192.168.205.107.
Escape character is '^]'.
stat //手動(dòng)輸入
Zookeeper version: 3.4.5-cdh6.9.2--1, built on 04/04/2017 08:43 GMT
Clients:
/192.168.205.107:35132[1](queued=0,recved=445,sent=445)
/192.168.205.107:35125[1](queued=0,recved=912,sent=912)
/192.168.205.107:35227[1](queued=0,recved=7233,sent=7233)
/192.168.205.107:35133[1](queued=0,recved=470,sent=470)
/192.168.205.107:45868[0](queued=0,recved=1,sent=0)
/192.168.205.107:35075[1](queued=0,recved=529,sent=531)
/192.168.205.107:35100[1](queued=0,recved=453,sent=453)
/192.168.205.107:35083[1](queued=0,recved=2447,sent=2484)
Latency min/avg/max: 0/0/231
Received: 16267
Sent: 16595
Connections: 8
Outstanding: 0
Zxid: 0x855
Mode: standalone
Node count: 44
Connection closed by foreign host.
參考鏈接:https://www.cloudera.com/documentation/enterprise/5-13-x/topics/cm_mc_zookeeper_service.html#xd_583c10bfdbd326ba--6eed2fb8-14349d04bee--7f1a
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。