此處省略安裝搭建過程
備註:當前為三節點伺服器,可允許損壞乙個,群集狀態正常,還可以提供正常服務,如損壞節點兩個,只剩下乙個節點,整個zookeeper服務中斷,無法連線。
[root@ops-site zookeeper]# ./bin/zkserver.sh status
jmx enabled by default
mode: follower #當前狀態為follwer
[root@nbutest zookeeper]# ifconfig
eth1 link encap:ethernet hwaddr 00:50:56:aa:87:1a
inet addr:10.3.151.34 bcast:10.3.151.255 mask:255.255.255.0
inet6 addr: fe80::250:56ff:feaa:871a/64 scope:link
up broadcast running multicast mtu:1500 metric:1
rx packets:296878910 errors:0 dropped:0 overruns:0 frame:0
tx packets:101828532 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
rx bytes:113708004182 (105.8 gib) tx bytes:40542901999 (37.7 gib)
lo link encap:local loopback
inet addr:127.0.0.1 mask:255.0.0.0
inet6 addr: ::1/128 scope:host
up loopback running mtu:65536 metric:1
rx packets:4575037 errors:0 dropped:0 overruns:0 frame:0
tx packets:4575037 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
rx bytes:442475408 (421.9 mib) tx bytes:442475408 (421.9 mib)
[root@nbutest zookeeper]# ./bin/zkserver.sh status
jmx enabled by default
mode: leader #當前為leader狀態
[root@nbutest zookeeper]# ./bin/zkcli.sh -server 10.3.151.34:2181 #連線方法
connecting to 10.3.151.34:2181
[zk: 10.3.151.34:2181(connected) 0] create /mingkang test
created /mingkang #建立了乙個/mingkang znode節點
[zk: 10.3.151.34:2181(connected) 1] ls / #檢視所有情況
[bb, cc, path, test, zookeeper, mingkang, bear, hehe, kang]
zookeeper集群搭建
接觸zookeeper集群已有很長很長一段時間了,zookeeper在專案中的使用相當的頻繁,如dubb服務 amq集群 大資料領域hadoop等。zookeeper的集群建立非常簡單,一直想寫一篇文章來對集群使用的介紹,但一直沒能抽出空,今天正好閒來無事,就重新實踐一遍來整理記錄,下文是基本的集群...
zookeeper集群搭建
zookeeper環境搭建需要保證奇數臺機器,以保證演算法能選舉出乙個leader。一 環境準備 datadir dir ticktime 2000 initlimit 5 synclimit 2 clientport 2181 server.0 192.168.1.100 2888 3888 se...
zookeeper集群搭建
1.準備工作 tomcat zookeeper 最少三個結點搭乙個集群,所以複製三份 2.搭建並配置三個zookeeper例項 cd usr local solr cloud zookeeper01 進zookeeper01目錄,mkdir data 該目錄下建立data資料夾,放置zookeepe...