{"id":50420,"date":"2025-07-30T23:22:58","date_gmt":"2025-07-30T15:22:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50420.html"},"modified":"2025-07-30T23:22:58","modified_gmt":"2025-07-30T15:22:58","slug":"zookeeper%e9%9b%86%e7%be%a4%e9%83%a8%e7%bd%b2%e4%b8%8e%e9%80%89%e4%b8%be%e6%9c%ba%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50420.html","title":{"rendered":"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236"},"content":{"rendered":"<h2>\u4e00\u3001\u6982\u8ff0<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ZooKeeper \u662f Apache \u57fa\u91d1\u4f1a\u5f00\u53d1\u7684\u4e00\u6b3e\u5206\u5e03\u5f0f\u534f\u8c03\u670d\u52a1&#xff0c;\u4e13\u4e3a\u89e3\u51b3\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u4e00\u81f4\u6027\u3001\u540c\u6b65\u3001\u914d\u7f6e\u7ba1\u7406\u7b49\u6838\u5fc3\u95ee\u9898\u800c\u8bbe\u8ba1\u3002<\/p>\n<h3>1.1 \u6570\u636e\u6a21\u578b\u4e0e\u5e94\u7528\u573a\u666f<\/h3>\n<h4>1.1.1 \u6570\u636e\u6a21\u578b<\/h4>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"306\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0a012c.png\" width=\"501\" \/><\/p>\n<p>&#xff08;1&#xff09;ZooKeeper \u7684\u6570\u636e\u7ed3\u6784\u7c7b\u4f3c Unix \u6587\u4ef6\u7cfb\u7edf&#xff0c;\u662f\u4e00\u4e2a\u6811\u5f62\u7ed3\u6784&#xff08;ZNode Tree&#xff09;\u3002<\/p>\n<p>&#xff08;2&#xff09;\u6bcf\u4e2a\u8282\u70b9\u79f0\u4e3a ZNode&#xff0c;\u53ef\u4ee5\u5b58\u50a8\u6570\u636e&#xff08;\u6700\u5927 1MB&#xff09;\u5e76\u6302\u8f7d\u5b50\u8282\u70b9\u3002<\/p>\n<p>&#xff08;3&#xff09;ZNode \u5206\u4e3a\u56db\u7c7b&#xff0c;\u4e3b\u8981\u57fa\u4e8e\u6301\u4e45\u6027\u548c\u987a\u5e8f\u6027\u4e24\u4e2a\u7ef4\u5ea6\u5212\u5206\u3002<\/p>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td style=\"text-align:center\">\u7c7b\u578b<\/td>\n<td style=\"text-align:center\">\u6301\u4e45\u6027<\/td>\n<td style=\"text-align:center\">\u81ea\u52a8\u751f\u6210\u5e8f\u5217\u53f7<\/td>\n<td style=\"text-align:center\">\u662f\u5426\u652f\u6301\u5b50\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u6301\u4e45\u8282\u70b9<\/td>\n<td style=\"text-align:center\">\u4f1a\u8bdd\u7ed3\u675f\u540e\u4fdd\u7559<\/td>\n<td style=\"text-align:center\">\u00d7<\/td>\n<td style=\"text-align:center\">\u2714<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u6301\u8282\u987a\u5e8f\u8282\u70b9<\/td>\n<td style=\"text-align:center\">\u4f1a\u8bdd\u7ed3\u675f\u540e\u4fdd\u7559<\/td>\n<td style=\"text-align:center\">\u2714<\/td>\n<td style=\"text-align:center\">\u2714<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u4e34\u65f6\u8282\u70b9<\/td>\n<td style=\"text-align:center\">\u4f1a\u8bdd\u7ed3\u675f\u540e\u5220\u9664<\/td>\n<td style=\"text-align:center\">\u00d7<\/td>\n<td style=\"text-align:center\">\u00d7<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u4e34\u65f6\u987a\u5e8f\u8282\u70b9<\/td>\n<td style=\"text-align:center\">\u4f1a\u8bdd\u7ed3\u675f\u540e\u5220\u9664<\/td>\n<td style=\"text-align:center\">\u2714<\/td>\n<td style=\"text-align:center\">\u00d7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.1.2 \u5e94\u7528\u573a\u666f<\/h4>\n<p>&#xff08;1&#xff09;\u7edf\u4e00\u547d\u540d\u670d\u52a1<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"332\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0b7729.png\" width=\"624\" \/><\/p>\n<p>&#xff08;2&#xff09;\u7edf\u4e00\u914d\u7f6e\u7ba1\u7406<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"244\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0cde0b.png\" width=\"841\" \/><\/p>\n<p>&#xff08;3&#xff09;\u7edf\u4e00\u96c6\u7fa4\u7ba1\u7406<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"414\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0e98ed.png\" width=\"893\" \/><\/p>\n<p>&#xff08;4&#xff09;\u611f\u77e5\u8282\u70b9\u4e0a\u4e0b\u7ebf<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"407\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d119f95.png\" width=\"802\" \/><\/p>\n<h3>1.2 zookeeper\u7279\u70b9<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"311\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d1415cf.png\" width=\"726\" \/><\/p>\n<ul>\n<li>Zookeeper&#xff1a;\u4e00\u4e2a\u9886\u5bfc\u8005&#xff08;Leader&#xff09;&#xff0c;\u591a\u4e2a\u8ddf\u968f\u8005&#xff08;Follower&#xff09;\u7ec4\u6210\u7684\u96c6\u7fa4\u3002<\/li>\n<li>\u96c6\u7fa4\u4e2d\u53ea\u8981\u6709\u534a\u6570\u4ee5\u4e0a\u8282\u70b9\u5b58\u6d3b&#xff0c;Zookeeper\u96c6\u7fa4\u5c31\u80fd\u6b63\u5e38\u670d\u52a1\u3002\u6240\u4ee5Zookeeper\u9002\u5408\u5b89\u88c5\u5947\u6570\u53f0\u670d\u52a1\u5668\u3002<\/li>\n<li>\u5168\u5c40\u6570\u636e\u4e00\u81f4&#xff1a;\u6bcf\u4e2aServer\u4fdd\u5b58\u4e00\u4efd\u76f8\u540c\u7684\u6570\u636e\u526f\u672c&#xff0c;Client\u65e0\u8bba\u8fde\u63a5\u5230\u54ea\u4e2aServer&#xff0c;\u6570\u636e\u90fd\u662f\u4e00\u81f4\u7684\u3002<\/li>\n<li>\u66f4\u65b0\u8bf7\u6c42\u987a\u5e8f\u6267\u884c&#xff0c;\u6765\u81ea\u540c\u4e00\u4e2aClient\u7684\u66f4\u65b0\u8bf7\u6c42\u6309\u5176\u53d1\u9001\u987a\u5e8f\u4f9d\u6b21\u6267\u884c\u3002<\/li>\n<li>\u6570\u636e\u66f4\u65b0\u539f\u5b50\u6027&#xff0c;\u4e00\u6b21\u6570\u636e\u66f4\u65b0\u8981\u4e48\u6210\u529f&#xff0c;\u8981\u4e48\u5931\u8d25\u3002<\/li>\n<li>\u5b9e\u65f6\u6027&#xff0c;\u5728\u4e00\u5b9a\u65f6\u95f4\u8303\u56f4\u5185&#xff0c;Client\u80fd\u8bfb\u5230\u6700\u65b0\u6570\u636e\u3002<\/li>\n<\/ul>\n<h2>\u4e8c\u3001\u96c6\u7fa4\u90e8\u7f72<\/h2>\n<h3>2.1 \u4e0b\u8f7d\u5730\u5740<\/h3>\n<p><span class=\"link-card-box\"><span class=\"link-title\">Apache ZooKeeper<\/span><span class=\"link-link\"><img decoding=\"async\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d154d38.png\" \/>https:\/\/zookeeper.apache.org\/documentation.html<\/span><\/span><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"594\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d15ead4.png\" width=\"1036\" \/><\/p>\n<h3>2.2 \u90e8\u7f72<\/h3>\n<li>zookeeper\u4f9d\u8d56java\u73af\u5883&#xff0c;\u8bf7\u81ea\u884c\u4e0b\u8f7d\u5b89\u88c5jdk<\/li>\n<li>\u628azookeeper\u5b89\u88c5\u5305\u4e0a\u4f20\u5230\/opt\/software\u76ee\u5f55\u4e0b<\/li>\n<li>\u89e3\u538b\u5230\/opt\/module\u76ee\u5f55\u4e0b [root&#064;hadoop101 software]# tar -zxvf \/opt\/software\/apache-zookeeper-3.5.7-bin.tar.gz -C \/opt\/module\/<br \/>\n[root&#064;hadoop101 software]# cd ..\/module\/<br \/>\n[root&#064;hadoop101 module]# ls<br \/>\napache-zookeeper-3.5.7-bin  jdk-1.8<br \/>\n[root&#064;hadoop101 module]# mv apache-zookeeper-3.5.7-bin\/ zookeeper-3.5.7<br \/>\n[root&#064;hadoop101 module]# ls<br \/>\njdk-1.8  zookeeper-3.5.7 <\/li>\n<li>\n<p>\u7f16\u8f91\u540c\u6b65\u811a\u672c<\/p>\n<p> mkdir \/root\/bin<br \/>\nvim \/root\/bin\/xsync.sh<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#!\/bin\/bash<\/p>\n<p>if [ $# -lt 1 ]<br \/>\nthen<br \/>\n        echo No Enough Argument!<br \/>\n        exit<br \/>\nfi<\/p>\n<p>for host in hadoop101 hadoop102 hadoop103 hadoop104<br \/>\ndo<br \/>\n        echo &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;host&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p>        for file in $&#064;<br \/>\n        do<br \/>\n                if [ -e $file ]<br \/>\n                then<br \/>\n                        pdir&#061;$(cd -P $(dirname $file); pwd)<br \/>\n                        fname&#061;$(basename $file)<br \/>\n                        ssh $host &#034;mkdir -p $pdir&#034;<br \/>\n                        echo $host $pdir $fname<br \/>\n                        echo rsync -av $pdir\/$fname $host:$pdir<br \/>\n                        rsync -av $pdir\/$fname $host:$pdir<br \/>\n                else<br \/>\n                        echo $file does not exists!<br \/>\n                fi<br \/>\n        done<br \/>\ndone<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nchmod 775 \/root\/bin\/xsync.sh <\/li>\n<li>\n<p>\u521b\u5efa\u6570\u636e\u5b58\u50a8\u76ee\u5f55<\/p>\n<p> [root&#064;hadoop101 zookeeper]# mkdir -p \/data\/zookeeper<br \/>\n[root&#064;hadoop101 zookeeper]# vim \/data\/zookeeper\/myid<br \/>\n[root&#064;hadoop101 zookeeper]# echo 1 &gt; \/data\/zookeeper\/myid<br \/>\n[root&#064;hadoop101 zookeeper]# xsync.sh \/data\/zookeeper\/myid<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\u5728\u5176\u4ed6\u4e24\u53f0\u673a\u5668\u4e0a\u6267\u884c<br \/>\n[root&#064;hadoop102 zookeeper]# echo 2 &gt; \/data\/zookeeper\/myid<br \/>\n[root&#064;hadoop102 \/]# cd opt\/module\/<br \/>\n[root&#064;hadoop102 module]# ls<br \/>\njdk-1.8  zookeeper-3.5.7<\/p>\n<p>[root&#064;hadoop103 zookeeper]# echo 3 &gt; \/data\/zookeeper\/myid <\/li>\n<li>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5e76\u5206\u53d1<\/p>\n<p> [root&#064;hadoop101 conf]# cd \/opt\/module\/zookeeper-3.5.7\/conf\/<br \/>\n[root&#064;hadoop101 conf]# mv .\/zoo_sample.cfg zoo.cfg<br \/>\n[root&#064;hadoop101 conf]# vim zoo.cfg<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n# The number of milliseconds of each tick<br \/>\n# \u901a\u4fe1\u5fc3\u8df3\u65f6\u95f4&#xff0c;Zookeeper\u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u5fc3\u8df3\u65f6\u95f4&#xff0c;\u5355\u4f4d\u6beb\u79d2<br \/>\ntickTime&#061;2000<br \/>\n# The number of ticks that the initial<br \/>\n# synchronization phase can take<br \/>\n# Leader\u548cFollower\u521d\u59cb\u8fde\u63a5\u65f6\u80fd\u5bb9\u5fcd\u7684\u6700\u591a\u5fc3\u8df3\u6570&#xff08;tickTime\u7684\u6570\u91cf&#xff09;<br \/>\ninitLimit&#061;10<br \/>\n# The number of ticks that can pass between<br \/>\n# sending a request and getting an acknowledgement<br \/>\n# Leader\u548cFollower\u4e4b\u95f4\u901a\u4fe1\u65f6\u95f4\u5982\u679c\u8d85\u8fc7syncLimit * tickTime&#xff0c;Leader\u8ba4\u4e3aFollwer\u6b7b\u6389&#xff0c;\u4ece\u670d\u52a1\u5668\u5217\u8868\u4e2d\u5220\u9664Follwer\u3002<br \/>\nsyncLimit&#061;5<br \/>\n# the directory where the snapshot is stored.<br \/>\n# do not use \/tmp for storage, \/tmp here is just<br \/>\n# example sakes.<br \/>\ndataDir&#061;\/data\/zookeeper<br \/>\n# the port at which the clients will connect<br \/>\nclientPort&#061;2181<br \/>\n# the maximum number of client connections.<br \/>\n# increase this if you need to handle more clients<br \/>\n#maxClientCnxns&#061;60<br \/>\n#<br \/>\n# Be sure to read the maintenance section of the<br \/>\n# administrator guide before turning on autopurge.<br \/>\n#<br \/>\n# http:\/\/zookeeper.apache.org\/doc\/current\/zookeeperAdmin.html#sc_maintenance<br \/>\n#<br \/>\n# The number of snapshots to retain in dataDir<br \/>\n#autopurge.snapRetainCount&#061;3<br \/>\n# Purge task interval in hours<br \/>\n# Set to &#034;0&#034; to disable auto purge feature<br \/>\n#autopurge.purgeInterval&#061;1<\/p>\n<p># server.A&#061;B:C:D<br \/>\n# A\u662f\u4e00\u4e2a\u6570\u5b57&#xff0c;\u8868\u793a\u8fd9\u7b2c\u51e0\u53f7\u670d\u52a1\u5668&#xff1b;<br \/>\n# \u96c6\u7fa4\u6a21\u5f0f\u4e0b\u914d\u7f6e\u4e00\u4e2a\u6587\u4ef6myid&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u5728dataDir\u76ee\u5f55\u4e0b&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u91cc\u9762\u6709\u4e00\u6570\u636e\u5c31\u662fA\u7684\u503c&#xff0c;Zookeeper\u542f\u52a8\u65f6\u8bfb\u53d6\u6b64\u6587\u4ef6&#xff0c;\u62ff\u5230\u91cc\u9762\u7684\u6570\u636e\u4e0ezoo.cfg\u91cc\u9762\u7684\u914d\u7f6e\u4fe1\u606f\u6bd4\u8f83\u4ece\u800c\u5224\u65ad\u5230\u5e95\u662f\u54ea\u4e2aserver\u3002<br \/>\n# B\u662f\u8fd9\u4e2a\u670d\u52a1\u5668\u7684\u5730\u5740&#xff1b;<br \/>\n# C\u662f\u8fd9\u4e2a\u670d\u52a1\u5668Follower\u4e0e\u96c6\u7fa4\u4e2d\u7684Leader\u670d\u52a1\u5668\u4ea4\u6362\u4fe1\u606f\u7684\u7aef\u53e3&#xff1b;<br \/>\n# D\u662f\u4e07\u4e00\u96c6\u7fa4\u4e2d\u7684Leader\u670d\u52a1\u5668\u6302\u4e86&#xff0c;\u9700\u8981\u4e00\u4e2a\u7aef\u53e3\u6765\u91cd\u65b0\u8fdb\u884c\u9009\u4e3e&#xff0c;\u9009\u51fa\u4e00\u4e2a\u65b0\u7684leader&#xff0c;\u800c\u8fd9\u4e2a\u7aef\u53e3\u5c31\u662f\u7528\u6765\u6267\u884c\u9009\u4e3e\u65f6\u670d\u52a1\u5668\u76f8\u4e92\u901a\u4fe1\u7684\u7aef\u53e3\u3002<br \/>\nserver.1&#061;hadoop101:2888:3888<br \/>\nserver.2&#061;hadoop102:2888:3888<br \/>\nserver.3&#061;hadoop103:2888:3888<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n[root&#064;hadoop101 zookeeper]# xsync.sh \/opt\/module\/zookeeper-3.5.7 <\/li>\n<li>\n<p>\u7f16\u5199\u96c6\u7fa4\u7fa4\u8d77\u811a\u672c<\/p>\n<p> [root&#064;hadoop101 zookeeper]# vim \/root\/bin\/zk.sh<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n#!\/bin\/bash<\/p>\n<p>case $1 in<br \/>\n&#034;start&#034;){<br \/>\n        for i in hadoop101 hadoop102 hadoop103<br \/>\n        do<br \/>\n                echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper $i \u542f\u52a8&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n                ssh $i \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh start<br \/>\n        done<br \/>\n};;<br \/>\n&#034;stop&#034;){<br \/>\n        for i in hadoop101 hadoop102 hadoop103<br \/>\n        do<br \/>\n                echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper $i \u505c\u6b62&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n                ssh $i \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh stop<br \/>\n        done<br \/>\n};;<br \/>\n&#034;status&#034;){<br \/>\n        for i in hadoop101 hadoop102 hadoop103<br \/>\n        do<br \/>\n                echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper $i \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n                ssh $i \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh status<br \/>\n        done<br \/>\n};;<br \/>\nesac<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>[root&#064;hadoop101 zookeeper]# chmod 775 \/root\/bin\/zk.sh <\/li>\n<li>\n<p>\u542f\u52a8\u96c6\u7fa4<\/p>\n<p> [root&#064;hadoop101 bin]# zk.sh start<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop101 \u542f\u52a8&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop102 \u542f\u52a8&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop103 \u542f\u52a8&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<\/p>\n<p>[root&#064;hadoop101 bin]# zk.sh status<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop101 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: follower<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop102 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: leader<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop103 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: follower <\/li>\n<h2>\u4e09\u3001\u9009\u4e3e\u673a\u5236<\/h2>\n<p>\u4e3a\u4ec0\u4e48\u8981\u8fdb\u884cLeader\u9009\u4e3e&#xff1f; Leader \u4e3b\u8981\u4f5c\u7528\u662f\u4fdd\u8bc1\u5206\u5e03\u5f0f\u6570\u636e\u4e00\u81f4\u6027&#xff0c;\u5373\u6bcf\u4e2a\u8282\u70b9\u7684\u5b58\u50a8\u7684\u6570\u636e\u540c\u6b65\u3002\u9047\u5230\u4ee5\u4e0b\u4e24\u79cd\u60c5\u51b5\u9700\u8981\u8fdb\u884cLeader\u9009\u4e3e<\/p>\n<ul>\n<li>\n<p>\u670d\u52a1\u5668\u521d\u59cb\u5316\u542f\u52a8<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u5668\u8fd0\u884c\u671f\u95f4\u65e0\u6cd5\u548cLeader\u4fdd\u6301\u8fde\u63a5&#xff0c;Leader\u8282\u70b9\u5d29\u6e83&#xff0c;\u903b\u8f91\u65f6\u949f\u5d29\u6e83\u3002<\/p>\n<\/li>\n<\/ul>\n<p>SID&#xff1a;\u670d\u52a1\u5668ID\u3002\u7528\u6765\u552f\u4e00\u6807\u8bc6\u4e00\u53f0ZooKeeper\u96c6\u7fa4\u4e2d\u7684\u673a\u5668&#xff0c;\u6bcf\u53f0\u673a\u5668\u4e0d\u80fd\u91cd\u590d&#xff0c;\u548cmyid\u4e00\u81f4\u3002 ZXID&#xff1a;\u4e8b\u52a1ID\u3002ZXID\u662f\u4e00\u4e2a\u4e8b\u52a1ID&#xff0c;\u7528\u6765\u6807\u8bc6\u4e00\u6b21\u670d\u52a1\u5668\u72b6\u6001\u7684\u53d8\u66f4\u3002\u5728\u67d0\u4e00\u65f6\u523b&#xff0c;\u96c6\u7fa4\u4e2d\u7684\u6bcf\u53f0\u673a\u5668\u7684ZXID\u503c\u4e0d\u4e00\u5b9a\u5b8c\u5168\u4e00\u81f4&#xff0c;\u8fd9\u548cZooKeeper\u670d\u52a1\u5668\u5bf9\u4e8e\u5ba2\u6237\u7aef\u201c\u66f4\u65b0\u8bf7\u6c42\u201d\u7684\u5904\u7406\u903b\u8f91\u6709\u5173\u3002 Epoch&#xff1a;\u6bcf\u4e2aLeader\u4efb\u671f\u7684\u4ee3\u53f7\u3002\u6ca1\u6709Leader\u65f6\u540c\u4e00\u8f6e\u6295\u7968\u8fc7\u7a0b\u4e2d\u7684\u903b\u8f91\u65f6\u949f\u503c\u662f\u76f8\u540c\u7684\u3002\u6bcf\u6295\u5b8c\u4e00\u6b21\u7968\u8fd9\u4e2a\u6570\u636e\u5c31\u4f1a\u589e\u52a0\u3002<\/p>\n<p>\u6bcf\u4e2a\u670d\u52a1\u7684\u6295\u7968\u4e3a&#xff08;SID,ZXID,Epoch&#xff09;<\/p>\n<p>\u9009\u4e3eLeader\u89c4\u5219&#xff1a;<span style=\"color:#fe2c24\"> EPOCH\u5927\u7684\u76f4\u63a5\u80dc\u51fa&#xff1b;EPOCH\u76f8\u540c&#xff0c;\u4e8b\u52a1id\u5927\u7684\u80dc\u51fa&#xff1b;\u4e8b\u52a1id\u76f8\u540c&#xff0c;\u670d\u52a1\u5668id\u5927\u7684\u80dc\u51fa<\/span><\/p>\n<h3>3.1 \u7b2c\u4e00\u6b21\u542f\u52a8<\/h3>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"410\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d1bc139.png\" width=\"611\" \/><\/p>\n<li>Server1\u542f\u52a8&#xff0c;\u53d1\u8d77\u4e00\u6b21\u9009\u4e3e\u3002\u670d\u52a1\u56681\u6295\u81ea\u5df1\u4e00\u7968\u3002\u6295\u7968\u7684\u5185\u5bb9\u4e3a&#xff08;SID&#xff0c;ZXID&#xff09;\u3002SID\u5373Server\u7684id&#xff0c;\u5b89\u88c5zookeeper\u65f6\u914d\u7f6e\u6587\u4ef6\u4e2d\u6240\u914d\u7f6e\u7684myid&#xff1b;ZXID&#xff0c;\u4e8b\u52a1id&#xff0c;\u4e3a\u8282\u70b9\u7684\u66f4\u65b0\u7a0b\u5ea6&#xff0c;ZXID\u8d8a\u5927&#xff0c;\u4ee3\u8868Server\u5bf9Znode\u7684\u64cd\u4f5c\u8d8a\u65b0\u3002\u7531\u4e8e\u670d\u52a1\u5668\u521d\u59cb\u5316&#xff0c;\u6bcf\u4e2aSever\u4e0a\u7684Znode\u4e3a0&#xff0c;\u6240\u4ee5Server1\u6295\u7684\u7968\u4e3a&#xff08;1,0&#xff09;\u6b64\u65f6\u670d\u52a1\u56681\u7968\u6570\u4e00\u7968&#xff0c;\u4e0d\u591f\u534a\u6570\u4ee5\u4e0a&#xff08;2\u7968&#xff09;&#xff0c;\u9009\u4e3e\u65e0\u6cd5\u5b8c\u6210&#xff0c;\u670d\u52a1\u56681\u72b6\u6001\u4fdd\u6301\u4e3aLOOKING&#xff1b; [root&#064;hadoop101 bin]# \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh start<br \/>\n\/opt\/module\/jdk-1.8\/bin\/java<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<\/p>\n<p>####\u4ee5\u4e0b\u5185\u5bb9\u53ef\u4ee5\u770b\u5230&#xff0c;zk\u8fdb\u7a0b\u5df2\u7ecf\u542f\u52a8&#xff0c;\u4f46\u4ed6\u6ca1\u6709\u6210\u4e3aleader<\/p>\n<p>[root&#064;hadoop101 bin]# zk.sh status<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop101 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nError contacting service. It is probably not running.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop102 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nError contacting service. It is probably not running.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop103 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nError contacting service. It is probably not running.<\/p>\n<p>[root&#064;hadoop101 bin]# jps<br \/>\n19809 Jps<br \/>\n19709 QuorumPeerMain <\/li>\n<li>\n<p>Server2\u542f\u52a8&#xff0c;\u518d\u53d1\u8d77\u4e00\u6b21\u9009\u4e3e\u3002Server1\u548c2\u5206\u522b\u6295\u81ea\u5df1\u4e00\u7968\u5e76\u4ea4\u6362\u9009\u7968\u4fe1\u606f&#xff1a;\u6b64\u65f6Server1\u53d1\u73b0Server2\u7684myid\u6bd4\u81ea\u5df1\u76ee\u524d\u6295\u7968\u63a8\u4e3e\u7684&#xff08;Server1&#xff09;\u5927&#xff0c;\u66f4\u6539\u9009\u7968\u4e3a\u63a8\u4e3eServer2\u3002\u6b64\u65f6Server1\u7968\u65700\u7968&#xff0c;Server2\u7968\u65702\u7968&#xff0c;\u8fbe\u5230\u534a\u6570\u4ee5\u4e0a\u7ed3\u679c&#xff0c;Server2\u5f53\u9009Leader\u3002Server1\u66f4\u6539\u72b6\u6001\u4e3aFOLLOWER&#xff0c;Server2\u66f4\u6539\u72b6\u6001\u4e3aLEADER&#xff1b;<\/p>\n<p> [root&#064;hadoop102 conf]# \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh start<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<br \/>\nYou have mail in \/var\/spool\/mail\/root<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n[root&#064;hadoop101 bin]# zk.sh status<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop101 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: follower<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop102 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: leader<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop103 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nError contacting service. It is probably not running. <\/li>\n<li>\n<p>Server3\u542f\u52a8&#xff0c;\u53d1\u8d77\u4e00\u6b21\u9009\u4e3e\u3002\u6b64\u65f6Server1&#xff0c;2\u5df2\u7ecf\u4e0d\u662fLOOKING\u72b6\u6001&#xff0c;\u4e0d\u4f1a\u66f4\u6539\u9009\u7968\u4fe1\u606f\u3002\u4ea4\u6362\u9009\u7968\u4fe1\u606f\u7ed3\u679c&#xff1a;Server2\u4e3a2\u7968&#xff0c;Server3\u4e3a1\u7968\u3002\u6b64\u65f6Server3\u670d\u4ece\u591a\u6570&#xff0c;\u66f4\u6539\u9009\u7968\u4fe1\u606f\u4e3aServer2&#xff0c;\u5e76\u66f4\u6539\u72b6\u6001\u4e3aFOLLOWER&#xff1b;<\/p>\n<p> [root&#064;hadoop103 zookeeper]# \/opt\/module\/zookeeper-3.5.7\/bin\/zkServer.sh start<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nStarting zookeeper &#8230; STARTED<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n[root&#064;hadoop101 bin]# zk.sh status<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop101 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: follower<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop102 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: leader<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;zookeeper hadoop103 \u72b6\u6001&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nZooKeeper JMX enabled by default<br \/>\nUsing config: \/opt\/module\/zookeeper-3.5.7\/bin\/..\/conf\/zoo.cfg<br \/>\nClient port found: 2181. Client address: localhost.<br \/>\nMode: follower <\/li>\n<h3>3.2 \u975e\u7b2c\u4e00\u6b21\u542f\u52a8<\/h3>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"281\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152257-688a38d1d7f7d.png\" width=\"566\" \/><\/p>\n<p>\u800c\u5f53\u4e00\u53f0\u673a\u5668\u8fdb\u5165Leader\u9009\u4e3e\u6d41\u7a0b\u65f6&#xff0c;\u5f53\u524d\u96c6\u7fa4\u4e5f\u53ef\u80fd\u4f1a\u5904\u4e8e\u4ee5\u4e0b\u4e24\u79cd\u72b6\u6001&#xff1a; \u2022 \u96c6\u7fa4\u4e2d\u672c\u6765\u5c31\u5df2\u7ecf\u5b58\u5728\u4e00\u4e2aLeader\u3002 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bf9\u4e8e\u7b2c\u4e00\u79cd\u5df2\u7ecf\u5b58\u5728Leader\u7684\u60c5\u51b5&#xff0c;\u673a\u5668\u8bd5\u56fe\u53bb\u9009\u4e3eLeader\u65f6&#xff0c;\u4f1a\u88ab\u544a\u77e5\u5f53\u524d\u670d\u52a1\u5668\u7684Leader\u4fe1\u606f&#xff0c;\u5bf9\u4e8e\u8be5\u673a\u5668\u6765\u8bf4&#xff0c;\u4ec5\u4ec5\u9700\u8981\u548cLeader\u673a\u5668\u5efa\u7acb\u8fde \u63a5&#xff0c;\u5e76\u8fdb\u884c\u72b6\u6001\u540c\u6b65\u5373\u53ef\u3002 \u2022 \u96c6\u7fa4\u4e2d\u786e\u5b9e\u4e0d\u5b58\u5728Leader\u3002 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5047\u8bbeZooKeeper\u75313\u53f0\u670d\u52a1\u5668\u7ec4\u6210&#xff0c;SID\u5206\u522b\u4e3a1\u30012\u30013&#xff1b;ZXID\u5206\u522b\u4e3a8\u30018\u30017&#xff0c;\u5e76\u4e14\u6b64\u65f6SID\u4e3a2\u7684\u670d\u52a1\u662fLeader\u3002\u67d0\u4e00\u65f6\u523b&#xff0c;\u670d\u52a12\u51fa\u73b0\u6545\u969c&#xff0c;\u56e0\u6b64\u5f00\u59cb\u8fdb\u884cLeader\u9009\u4e3e\u3002\u670d\u52a11\u7531\u4e8e\u4e8b\u52a1id&#xff0c;\u80dc\u51fa\u3002<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb809\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf12\u6b21\u3002ZooKeeper \u662f Apache \u57fa\u91d1\u4f1a\u5f00\u53d1\u7684\u4e00\u6b3e\uff0c\u4e13\u4e3a\u89e3\u51b3\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u4e00\u81f4\u6027\u3001\u540c\u6b65\u3001\u914d\u7f6e\u7ba1\u7406\u7b49\u6838\u5fc3\u95ee\u9898\u800c\u8bbe\u8ba1\u3002<\/p>\n","protected":false},"author":2,"featured_media":50410,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[779,1898,763,664],"topic":[],"class_list":["post-50420","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-hadoop","tag-zookeeper","tag-763","tag-664"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/50420.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb809\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf12\u6b21\u3002ZooKeeper \u662f Apache \u57fa\u91d1\u4f1a\u5f00\u53d1\u7684\u4e00\u6b3e\uff0c\u4e13\u4e3a\u89e3\u51b3\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u4e00\u81f4\u6027\u3001\u540c\u6b65\u3001\u914d\u7f6e\u7ba1\u7406\u7b49\u6838\u5fc3\u95ee\u9898\u800c\u8bbe\u8ba1\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50420.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T15:22:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0a012c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50420.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50420.html\",\"name\":\"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T15:22:58+00:00\",\"dateModified\":\"2025-07-30T15:22:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50420.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50420.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50420.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/50420.html","og_locale":"zh_CN","og_type":"article","og_title":"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb809\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf12\u6b21\u3002ZooKeeper \u662f Apache \u57fa\u91d1\u4f1a\u5f00\u53d1\u7684\u4e00\u6b3e\uff0c\u4e13\u4e3a\u89e3\u51b3\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u4e00\u81f4\u6027\u3001\u540c\u6b65\u3001\u914d\u7f6e\u7ba1\u7406\u7b49\u6838\u5fc3\u95ee\u9898\u800c\u8bbe\u8ba1\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/50420.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T15:22:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730152256-688a38d0a012c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50420.html","url":"https:\/\/www.wsisp.com\/helps\/50420.html","name":"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T15:22:58+00:00","dateModified":"2025-07-30T15:22:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50420.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50420.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50420.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"zookeeper\u96c6\u7fa4\u90e8\u7f72\u4e0e\u9009\u4e3e\u673a\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=50420"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50420\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/50410"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50420"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}