{"id":80044,"date":"2026-03-04T08:17:07","date_gmt":"2026-03-04T00:17:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/80044.html"},"modified":"2026-03-04T08:17:07","modified_gmt":"2026-03-04T00:17:07","slug":"kafka-zookeeper%e6%9e%b6%e6%9e%84%e5%9f%ba%e7%a1%80%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/80044.html","title":{"rendered":"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd"},"content":{"rendered":"<h2>Kafka &#043; ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd<\/h2>\n<h3>\u4e00\u3001\u6574\u4f53\u67b6\u6784<\/h3>\n<p>ZooKeeper \u662f Kafka 2.8 \u4e4b\u524d\u7684\u5fc5\u9009\u534f\u8c03\u7ec4\u4ef6&#xff0c;\u53ea\u505a\u96c6\u7fa4\u7ba1\u63a7&#xff0c;\u4e0d\u53c2\u4e0e\u6d88\u606f\u8bfb\u5199&#xff1a;<\/p>\n<ul>\n<li>\u5b58\u50a8\u96c6\u7fa4\u5143\u6570\u636e&#xff08;Broker\u3001Topic\u3001\u5206\u533a\u3001\u526f\u672c\u3001ISR \u4fe1\u606f&#xff09;<\/li>\n<li>\u63d0\u4f9b\u5206\u5e03\u5f0f\u9501\u4e0e\u4e34\u65f6\u8282\u70b9&#xff0c;\u5b9e\u73b0 Kafka Controller \u9009\u4e3e<\/li>\n<li>\u611f\u77e5 Broker \u4e0a\u4e0b\u7ebf<\/li>\n<li>\u6301\u4e45\u5316\u5206\u533a Leader \u72b6\u6001<\/li>\n<\/ul>\n<p>Kafka \u53ea\u8d1f\u8d23&#xff1a;\u6d88\u606f\u63a5\u6536\u3001\u5b58\u50a8\u3001\u590d\u5236\u3001\u6d88\u8d39\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001ZooKeeper \u5728 Kafka \u4e2d\u7684\u6838\u5fc3\u4f5c\u7528<\/h3>\n<h4>1. \u5b58\u50a8\u7684\u5173\u952e\u5143\u6570\u636e&#xff08;ZK \u8282\u70b9\u8def\u5f84&#xff09;<\/h4>\n<table>\n<tr>ZK \u8282\u70b9\u8def\u5f84\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>\/brokers\/ids\/[brokerId]<\/td>\n<td>Broker \u6ce8\u518c\u4e34\u65f6\u8282\u70b9&#xff0c;\u6807\u8bb0\u5b58\u6d3b<\/td>\n<\/tr>\n<tr>\n<td>\/brokers\/topics\/[topic]<\/td>\n<td>\u4e3b\u9898\u7684\u5206\u533a\u6570\u3001\u526f\u672c\u5206\u914d\u65b9\u6848<\/td>\n<\/tr>\n<tr>\n<td>\/brokers\/topics\/[topic]\/partitions\/[N]\/state<\/td>\n<td>\u5206\u533a\u72b6\u6001&#xff1a;Leader\u3001ISR\u3001\u526f\u672c\u96c6\u5408<\/td>\n<\/tr>\n<tr>\n<td>\/controller<\/td>\n<td>\u4fdd\u5b58\u5f53\u524d Controller \u4fe1\u606f&#xff08;\u4e34\u65f6\u8282\u70b9&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\/config\/topics\/[topic]<\/td>\n<td>\u4e3b\u9898\u7ea7\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>\/admin\/delete_topics<\/td>\n<td>\u5f85\u5220\u9664\u4e3b\u9898\u961f\u5217<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2. \u56db\u5927\u6838\u5fc3\u804c\u8d23<\/h4>\n<li>\n<p>Broker \u6ce8\u518c\u4e0e\u5065\u5eb7\u68c0\u6d4b<\/p>\n<ul>\n<li>Broker \u542f\u52a8 \u2192 \u521b\u5efa\u4e34\u65f6\u8282\u70b9 \/brokers\/ids\/xx<\/li>\n<li>\u65ad\u5f00\u8fde\u63a5 \u2192 \u8282\u70b9\u81ea\u52a8\u5220\u9664 \u2192 Kafka \u611f\u77e5\u4e0b\u7ebf\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Kafka Controller \u9009\u4e3e<\/p>\n<ul>\n<li>\u6240\u6709 Broker \u4e89\u62a2\u521b\u5efa \/controller \u4e34\u65f6\u8282\u70b9&#xff0c;\u6210\u529f\u5373\u4e3a Controller\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5206\u533a Leader \u72b6\u6001\u6301\u4e45\u5316<\/p>\n<ul>\n<li>\u6bcf\u6b21 Leader \u53d8\u66f4&#xff0c;\u7ed3\u679c\u5199\u5165 ZooKeeper&#xff0c;\u4fdd\u8bc1\u5168\u5c40\u4e00\u81f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u96c6\u7fa4\u7edf\u4e00\u89c6\u56fe<\/p>\n<ul>\n<li>\u6240\u6709 Broker \u5171\u4eab\u540c\u4e00\u4efd\u5143\u6570\u636e&#xff0c;\u4e0d\u4f1a\u51fa\u73b0\u8111\u88c2\u3002<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h3>\u4e09\u3001ZooKeeper \u914d\u7f6e&#xff08;\u4f9b Kafka \u4f7f\u7528&#xff09;<\/h3>\n<h4>zoo.cfg \u5b8c\u6574\u914d\u7f6e<\/h4>\n<p># \u57fa\u7840\u65f6\u95f4\u5355\u4f4d ms<br \/>\ntickTime&#061;2000<br \/>\ninitLimit&#061;10<br \/>\nsyncLimit&#061;5<\/p>\n<p># \u6570\u636e\u76ee\u5f55&#xff08;\u751f\u4ea7\u5fc5\u987b\u72ec\u7acb\u78c1\u76d8&#xff09;<br \/>\ndataDir&#061;\/data\/zookeeper\/data<br \/>\ndataLogDir&#061;\/data\/zookeeper\/log<\/p>\n<p>clientPort&#061;2181<\/p>\n<p># Kafka \u96c6\u7fa4\u9700\u8981\u9ad8\u8fde\u63a5\u6570<br \/>\nmaxClientCnxns&#061;2000<\/p>\n<p># \u81ea\u52a8\u6e05\u7406\u5feb\u7167\u4e0e\u65e5\u5fd7<br \/>\nautopurge.snapRetainCount&#061;5<br \/>\nautopurge.purgeInterval&#061;24<\/p>\n<p># ZK \u96c6\u7fa4&#xff08;3 \u8282\u70b9\u793a\u4f8b&#xff09;<br \/>\nserver.1&#061;zk1:2888:3888<br \/>\nserver.2&#061;zk2:2888:3888<br \/>\nserver.3&#061;zk3:2888:3888<\/p>\n<h4>\u5173\u952e\u914d\u7f6e\u8bf4\u660e<\/h4>\n<ul>\n<li>dataDir&#xff1a;ZK \u5185\u5b58\u6570\u636e\u5feb\u7167\u76ee\u5f55<\/li>\n<li>dataLogDir&#xff1a;\u4e8b\u52a1\u65e5\u5fd7\u76ee\u5f55&#xff08;\u5fc5\u987b\u72ec\u7acb\u78c1\u76d8&#xff0c;\u6027\u80fd\u5173\u952e&#xff09;<\/li>\n<li>maxClientCnxns&#xff1a;Kafka \u96c6\u7fa4\u9700\u8c03\u9ad8&#xff0c;\u907f\u514d\u8fde\u63a5\u88ab\u62d2<\/li>\n<li>autopurge&#xff1a;\u9632\u6b62\u65e5\u5fd7\u5360\u6ee1\u78c1\u76d8<\/li>\n<\/ul>\n<h4>\u8282\u70b9\u6807\u8bc6&#xff08;\u5fc5\u987b\u914d\u7f6e&#xff09;<\/h4>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;1&#034;<\/span> <span class=\"token operator\">&gt;<\/span> \/data\/zookeeper\/data\/myid<\/p>\n<p>myid \u5fc5\u987b\u4e0e server.1\/2\/3 \u4e2d\u7684\u6570\u5b57\u4e00\u81f4\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001Kafka \u8fde\u63a5 ZooKeeper \u6838\u5fc3\u914d\u7f6e<\/h3>\n<h4>server.properties \u5173\u952e\u914d\u7f6e<\/h4>\n<p># \u552f\u4e00\u6807\u8bc6<br \/>\nbroker.id&#061;1<\/p>\n<p># \u76d1\u542c\u5730\u5740<br \/>\nlisteners&#061;PLAINTEXT:\/\/0.0.0.0:9092<br \/>\nadvertised.listeners&#061;PLAINTEXT:\/\/192.168.1.101:9092<\/p>\n<p># \u65e5\u5fd7\u5b58\u50a8<br \/>\nlog.dirs&#061;\/data\/kafka\/logs<br \/>\nnum.partitions&#061;8<br \/>\ndefault.replication.factor&#061;3<br \/>\nmin.insync.replicas&#061;2<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# ZK \u6838\u5fc3\u914d\u7f6e<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\nzookeeper.connect&#061;zk1:2181,zk2:2181,zk3:2181\/kafka<br \/>\nzookeeper.connection.timeout.ms&#061;10000<br \/>\nzookeeper.session.timeout.ms&#061;18000<\/p>\n<p># \u751f\u4ea7\u5173\u95ed\u81ea\u52a8\u521b\u5efa\u4e3b\u9898<br \/>\nauto.create.topics.enable&#061;false<br \/>\ndelete.topic.enable&#061;true<\/p>\n<h4>\u91cd\u70b9\u8bf4\u660e<\/h4>\n<ul>\n<li>zookeeper.connect \u672b\u5c3e \/kafka \u662f\u547d\u540d\u7a7a\u95f4&#xff0c;\u7528\u4e8e\u591a\u96c6\u7fa4\u9694\u79bb<\/li>\n<li>zookeeper.session.timeout.ms&#xff1a;\u8d85\u65f6\u5373\u8ba4\u4e3a Broker \u5df2\u4e0b\u7ebf<\/li>\n<li>min.insync.replicas&#xff1a;\u6700\u5c0f\u540c\u6b65\u526f\u672c\u6570&#xff0c;\u4fdd\u8bc1\u6570\u636e\u4e0d\u4e22\u5931<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e94\u3001Kafka \u5206\u533a\u4e3b\u4ece\u673a\u5236&#xff1a;Leader \/ Follower \/ ISR<\/h3>\n<h4>1. \u4e3b\u4ece\u89d2\u8272<\/h4>\n<ul>\n<li>Leader&#xff1a;\u6bcf\u4e2a\u5206\u533a\u53ea\u6709\u4e00\u4e2a&#xff0c;\u8d1f\u8d23\u8bfb\u5199<\/li>\n<li>Follower&#xff1a;\u53ea\u4ece Leader \u540c\u6b65\u6570\u636e&#xff0c;\u4e0d\u63d0\u4f9b\u8bfb\u5199<\/li>\n<li>ISR&#xff08;In-Sync Replicas&#xff09;&#xff1a;\u4e0e Leader \u4fdd\u6301\u540c\u6b65\u7684\u526f\u672c\u96c6\u5408<\/li>\n<\/ul>\n<h4>2. \u6838\u5fc3\u89c4\u5219<\/h4>\n<ul>\n<li>\u751f\u4ea7\u8005\u3001\u6d88\u8d39\u8005\u53ea\u4e0e Leader \u4ea4\u4e92<\/li>\n<li>Follower \u5f02\u6b65\u62c9\u53d6\u6d88\u606f<\/li>\n<li>\u53ea\u6709 ISR \u5185\u7684\u526f\u672c\u624d\u6709\u8d44\u683c\u88ab\u9009\u4e3a\u65b0 Leader<\/li>\n<\/ul>\n<h4>3. \u9ad8\u53ef\u7528\u4fdd\u8bc1<\/h4>\n<ul>\n<li>Leader \u5b95\u673a \u2192 \u4ece ISR \u4e2d\u9009\u65b0 Leader<\/li>\n<li>\u914d\u7f6e acks&#061;all &#043; min.insync.replicas&#061;2 \u53ef\u4fdd\u8bc1\u6d88\u606f\u4e0d\u4e22\u5931<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516d\u3001Kafka Controller \u9009\u4e3e\u6d41\u7a0b&#xff08;\u57fa\u4e8e ZK&#xff09;<\/h3>\n<h4>1. Controller \u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>\u96c6\u7fa4\u4e2d\u552f\u4e00\u7684\u7ba1\u7406\u8282\u70b9&#xff0c;\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u5206\u533a Leader \u9009\u4e3e<\/li>\n<li>\u526f\u672c\u5206\u914d\u4e0e\u91cd\u5206\u914d<\/li>\n<li>\u611f\u77e5 Broker \u4e0a\u4e0b\u7ebf<\/li>\n<li>\u540c\u6b65\u5143\u6570\u636e\u7ed9\u6240\u6709 Broker<\/li>\n<\/ul>\n<h4>2. \u9009\u4e3e\u6d41\u7a0b&#xff08;\u5b8c\u5168\u4f9d\u8d56 ZooKeeper&#xff09;<\/h4>\n<p>ZooKeeperBroker 3Broker 2Broker 1ZooKeeperBroker 3Broker 2Broker 1#mermaid-svg-rRsd8m7GDXMf1Gbt{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-rRsd8m7GDXMf1Gbt .error-icon{fill:#552222;}#mermaid-svg-rRsd8m7GDXMf1Gbt .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-rRsd8m7GDXMf1Gbt .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-rRsd8m7GDXMf1Gbt .marker{fill:#333333;stroke:#333333;}#mermaid-svg-rRsd8m7GDXMf1Gbt .marker.cross{stroke:#333333;}#mermaid-svg-rRsd8m7GDXMf1Gbt svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-rRsd8m7GDXMf1Gbt p{margin:0;}#mermaid-svg-rRsd8m7GDXMf1Gbt .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-rRsd8m7GDXMf1Gbt text.actor&gt;tspan{fill:black;stroke:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-rRsd8m7GDXMf1Gbt .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-rRsd8m7GDXMf1Gbt .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-rRsd8m7GDXMf1Gbt #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-rRsd8m7GDXMf1Gbt .sequenceNumber{fill:white;}#mermaid-svg-rRsd8m7GDXMf1Gbt #sequencenumber{fill:#333;}#mermaid-svg-rRsd8m7GDXMf1Gbt #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-rRsd8m7GDXMf1Gbt .messageText{fill:#333;stroke:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-rRsd8m7GDXMf1Gbt .labelText,#mermaid-svg-rRsd8m7GDXMf1Gbt .labelText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .loopText,#mermaid-svg-rRsd8m7GDXMf1Gbt .loopText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-rRsd8m7GDXMf1Gbt .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-rRsd8m7GDXMf1Gbt .noteText,#mermaid-svg-rRsd8m7GDXMf1Gbt .noteText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-rRsd8m7GDXMf1Gbt .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-rRsd8m7GDXMf1Gbt .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-rRsd8m7GDXMf1Gbt .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-rRsd8m7GDXMf1Gbt .actorPopupMenu{position:absolute;}#mermaid-svg-rRsd8m7GDXMf1Gbt .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 \/ 0.4));}#mermaid-svg-rRsd8m7GDXMf1Gbt .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-rRsd8m7GDXMf1Gbt .actor-man circle,#mermaid-svg-rRsd8m7GDXMf1Gbt line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-rRsd8m7GDXMf1Gbt :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u6240\u6709 Broker \u542f\u52a8B1 \u5b95\u673a&#xff08;\u7f51\u7edc\u65ad\u5f00&#xff09;create \/controller (ephemeral)\u6210\u529f \u2192 B1 \u6210\u4e3a Controllercreate \/controller \u2192 \u5931\u8d25watch \/controllercreate \/controller \u2192 \u5931\u8d25watch \/controllerSession \u8d85\u65f6&#xff08;~6s&#xff09;\u5220\u9664 \/controller \u8282\u70b9Watch \u89e6\u53d1create \/controller \u2192 \u6210\u529f \u2192 B2 \u6210\u4e3a\u65b0 Controller<\/p>\n<p>\u7279\u70b9&#xff1a;\u62a2\u5360\u5f0f\u3001\u7b80\u5355\u3001\u5f3a\u4f9d\u8d56 ZK \u4e34\u65f6\u8282\u70b9\u7279\u6027\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001Kafka \u5206\u533a Leader \u9009\u4e3e\u6d41\u7a0b<\/h3>\n<h4>\u89e6\u53d1\u65f6\u673a<\/h4>\n<ul>\n<li>Broker \u5b95\u673a<\/li>\n<li>\u5206\u533a\u91cd\u5206\u914d<\/li>\n<li>\u96c6\u7fa4\u542f\u52a8\/\u505c\u6b62<\/li>\n<\/ul>\n<h4>\u5b8c\u6574\u6d41\u7a0b<\/h4>\n<p>#mermaid-svg-4w4hRaYqRAjcGqT8{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-4w4hRaYqRAjcGqT8 .error-icon{fill:#552222;}#mermaid-svg-4w4hRaYqRAjcGqT8 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-4w4hRaYqRAjcGqT8 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .marker.cross{stroke:#333333;}#mermaid-svg-4w4hRaYqRAjcGqT8 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-4w4hRaYqRAjcGqT8 p{margin:0;}#mermaid-svg-4w4hRaYqRAjcGqT8 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster-label text{fill:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster-label span{color:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster-label span p{background-color:transparent;}#mermaid-svg-4w4hRaYqRAjcGqT8 .label text,#mermaid-svg-4w4hRaYqRAjcGqT8 span{fill:#333;color:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .node rect,#mermaid-svg-4w4hRaYqRAjcGqT8 .node circle,#mermaid-svg-4w4hRaYqRAjcGqT8 .node ellipse,#mermaid-svg-4w4hRaYqRAjcGqT8 .node polygon,#mermaid-svg-4w4hRaYqRAjcGqT8 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .rough-node .label text,#mermaid-svg-4w4hRaYqRAjcGqT8 .node .label text,#mermaid-svg-4w4hRaYqRAjcGqT8 .image-shape .label,#mermaid-svg-4w4hRaYqRAjcGqT8 .icon-shape .label{text-anchor:middle;}#mermaid-svg-4w4hRaYqRAjcGqT8 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .rough-node .label,#mermaid-svg-4w4hRaYqRAjcGqT8 .node .label,#mermaid-svg-4w4hRaYqRAjcGqT8 .image-shape .label,#mermaid-svg-4w4hRaYqRAjcGqT8 .icon-shape .label{text-align:center;}#mermaid-svg-4w4hRaYqRAjcGqT8 .node.clickable{cursor:pointer;}#mermaid-svg-4w4hRaYqRAjcGqT8 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .arrowheadPath{fill:#333333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-4w4hRaYqRAjcGqT8 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-4w4hRaYqRAjcGqT8 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-4w4hRaYqRAjcGqT8 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster text{fill:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 .cluster span{color:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-4w4hRaYqRAjcGqT8 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-4w4hRaYqRAjcGqT8 rect.text{fill:none;stroke-width:0;}#mermaid-svg-4w4hRaYqRAjcGqT8 .icon-shape,#mermaid-svg-4w4hRaYqRAjcGqT8 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-4w4hRaYqRAjcGqT8 .icon-shape p,#mermaid-svg-4w4hRaYqRAjcGqT8 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-4w4hRaYqRAjcGqT8 .icon-shape rect,#mermaid-svg-4w4hRaYqRAjcGqT8 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-4w4hRaYqRAjcGqT8 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-4w4hRaYqRAjcGqT8 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-4w4hRaYqRAjcGqT8 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>Controller \u76d1\u542c\u5230 Broker \u4e0b\u7ebf<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u83b7\u53d6\u8be5 Broker \u4e0a\u6240\u6709 Leader \u5206\u533a<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u904d\u5386\u6bcf\u4e2a\u5206\u533a<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u8be5\u5206\u533a\u7684 ISR \u5217\u8868<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u9009\u62e9\u7b2c\u4e00\u4e2a\u5b58\u6d3b\u7684\u526f\u672c\u4f5c\u4e3a\u65b0 Leader<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u66f4\u65b0 ZK \u4e2d\u7684\u5206\u533a\u72b6\u6001<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5e7f\u64ad\u65b0 Leader\u5230\u6240\u6709 Broker<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5ba2\u6237\u7aef\u5f00\u59cb\u8bbf\u95ee\u65b0 Leader<\/p>\n<p><\/span><\/p>\n<h4>\u8be6\u7ec6\u6b65\u9aa4<\/h4>\n<li>Controller \u901a\u8fc7 ZK \u76d1\u542c\u5230 Broker \u4e0b\u7ebf<\/li>\n<li>\u627e\u5230\u8be5 Broker \u4e0a\u6240\u6709 Leader \u5206\u533a<\/li>\n<li>\u5bf9\u6bcf\u4e2a\u5206\u533a\u6267\u884c&#xff1a;\n<ul>\n<li>\u8bfb\u53d6\u8be5\u5206\u533a\u7684 ISR \u5217\u8868<\/li>\n<li>\u9009\u62e9 \u7b2c\u4e00\u4e2a\u5b58\u6d3b\u7684\u526f\u672c \u4f5c\u4e3a\u65b0 Leader<\/li>\n<\/ul>\n<\/li>\n<li>\u5c06\u65b0\u72b6\u6001\u5199\u5165 ZK&#xff1a;<br \/>\n\/brokers\/topics\/[topic]\/partitions\/[x]\/state<\/li>\n<li>Controller \u628a\u65b0\u5143\u6570\u636e\u5e7f\u64ad\u7ed9\u6240\u6709 Broker<\/li>\n<li>\u5ba2\u6237\u7aef\u5f00\u59cb\u8bbf\u95ee\u65b0 Leader<\/li>\n<hr \/>\n<h3>\u516b\u3001Kafka \u4e3b\u4ece\u540c\u6b65\u673a\u5236<\/h3>\n<li>Follower \u4e3b\u52a8\u5411 Leader \u53d1\u8d77\u540c\u6b65\u8bf7\u6c42<\/li>\n<li>Leader \u5c06\u6d88\u606f\u5199\u5165\u540e&#xff0c;\u540c\u6b65\u7ed9 Follower<\/li>\n<li>Follower \u5199\u5165\u6210\u529f\u540e\u56de\u590d ACK<\/li>\n<li>\u6ee1\u8db3\u540c\u6b65\u6761\u4ef6\u540e\u52a0\u5165 ISR<\/li>\n<li>\u751f\u4ea7\u8005 acks&#061;all \u65f6&#xff1a;\n<ul>\n<li>\u5fc5\u987b\u7b49 ISR \u4e2d\u6240\u6709\u526f\u672c \u786e\u8ba4<\/li>\n<li>\u624d\u8fd4\u56de\u751f\u4ea7\u6210\u529f<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h3>\u4e5d\u3001\u5e38\u7528\u8fd0\u7ef4\u547d\u4ee4&#xff08;ZK &#043; Kafka&#xff09;<\/h3>\n<h4>1. \u67e5\u770b\u5f53\u524d Controller<\/h4>\n<p>bin\/zookeeper-shell.sh zk1:2181 get \/controller<\/p>\n<h4>2. \u67e5\u770b\u4e3b\u9898\u8be6\u60c5&#xff08;Leader \/ ISR&#xff09;<\/h4>\n<p>bin\/kafka-topics.sh <span class=\"token parameter variable\">&#8211;describe<\/span> <span class=\"token parameter variable\">&#8211;topic<\/span> <span class=\"token builtin class-name\">test<\/span> &#8211;bootstrap-server kafka1:9092<\/p>\n<h4>3. \u67e5\u770b\u5728\u7ebf Broker<\/h4>\n<p>bin\/zookeeper-shell.sh zk1:2181 <span class=\"token function\">ls<\/span> \/brokers\/ids<\/p>\n<h4>4. \u67e5\u770b\u5206\u533a\u72b6\u6001<\/h4>\n<p>bin\/zookeeper-shell.sh zk1:2181 get \/brokers\/topics\/test\/partitions\/0\/state<\/p>\n<hr \/>\n<h3>\u5341\u3001\u5173\u952e\u6545\u969c\u673a\u5236<\/h3>\n<h4>1. Broker \u5b95\u673a<\/h4>\n<ul>\n<li>ZK \u4f1a\u8bdd\u8d85\u65f6 \u2192 \/brokers\/ids\/xx \u6d88\u5931<\/li>\n<li>Controller \u76d1\u542c\u5230 \u2192 \u5f00\u59cb\u5206\u533a Leader \u8fc1\u79fb<\/li>\n<\/ul>\n<h4>2. Controller \u5b95\u673a<\/h4>\n<ul>\n<li>\/controller \u4e34\u65f6\u8282\u70b9\u6d88\u5931<\/li>\n<li>\u6240\u6709 Broker \u91cd\u65b0\u9009\u4e3e Controller<\/li>\n<li>\u65b0 Controller \u4ece ZK \u52a0\u8f7d\u5168\u91cf\u5143\u6570\u636e<\/li>\n<\/ul>\n<h4>3. ZK \u4e0d\u53ef\u7528\u5f71\u54cd<\/h4>\n<ul>\n<li>\u5df2\u6709\u7684\u6d88\u606f\u8bfb\u5199\u6b63\u5e38<\/li>\n<li>\u65e0\u6cd5\u521b\u5efa\/\u5220\u9664 Topic<\/li>\n<li>\u65e0\u6cd5\u91cd\u65b0\u9009\u4e3e Controller\u3001\u5206\u533a Leader<\/li>\n<li>\u65e0\u6cd5\u4e0a\u4e0b\u7ebf Broker<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u603b\u7ed3<\/h3>\n<li>ZooKeeper&#xff1a;Kafka \u96c6\u7fa4\u7684\u201c\u914d\u7f6e\u4e2d\u5fc3 &#043; \u534f\u8c03\u4e2d\u5fc3\u201d\u3002<\/li>\n<li>Broker \u6ce8\u518c&#xff1a;\u4f9d\u9760 ZK \u4e34\u65f6\u8282\u70b9\u5b9e\u73b0\u5b58\u6d3b\u68c0\u6d4b\u3002<\/li>\n<li>Controller \u9009\u4e3e&#xff1a;\u4e89\u62a2 ZK \/controller \u4e34\u65f6\u8282\u70b9\u5b9e\u73b0\u3002<\/li>\n<li>\u5206\u533a\u4e3b\u4ece&#xff1a;Leader \u63d0\u4f9b\u8bfb\u5199&#xff0c;Follower \u540c\u6b65&#xff0c;ISR \u4fdd\u8bc1\u9ad8\u53ef\u7528\u3002<\/li>\n<li>Leader \u9009\u4e3e&#xff1a;\u7531 Controller \u4ece ISR \u4e2d\u9009\u51fa&#xff0c;\u7ed3\u679c\u5b58\u5165 ZK\u3002<\/li>\n<li>ZK \u4f5c\u7528\u8fb9\u754c&#xff1a;\u53ea\u7ba1\u96c6\u7fa4\u534f\u8c03&#xff0c;\u4e0d\u7ba1\u6d88\u606f\u6536\u53d1\u3002<\/li>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Kafka  ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd<br \/>\n\u4e00\u3001\u6574\u4f53\u67b6\u6784<br \/>\nZooKeeper \u662f Kafka 2.8 \u4e4b\u524d\u7684\u5fc5\u9009\u534f\u8c03\u7ec4\u4ef6&#xff0c;\u53ea\u505a\u96c6\u7fa4\u7ba1\u63a7&#xff0c;\u4e0d\u53c2\u4e0e\u6d88\u606f\u8bfb\u5199&#xff1a;<br \/>\n\u5b58\u50a8\u96c6\u7fa4\u5143\u6570\u636e&#xff08;Broker\u3001Topic\u3001\u5206\u533a\u3001\u526f\u672c\u3001ISR \u4fe1\u606f&#xff09;\u63d0\u4f9b\u5206\u5e03\u5f0f\u9501\u4e0e\u4e34\u65f6\u8282\u70b9&#xff0c;\u5b9e\u73b0 Kafka Controller \u9009\u4e3e\u611f\u77e5 Broker \u4e0a\u4e0b\u7ebf\u6301\u4e45\u5316\u5206\u533a Leader \u72b6\u6001<br \/>\nKafka \u53ea\u8d1f\u8d23&#xff1a;\u6d88\u606f\u63a5\u6536\u3001\u5b58<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1114,1898,292],"topic":[],"class_list":["post-80044","post","type-post","status-publish","format-standard","hentry","category-server","tag-kafka","tag-zookeeper","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \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\/80044.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Kafka ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd \u4e00\u3001\u6574\u4f53\u67b6\u6784 ZooKeeper \u662f Kafka 2.8 \u4e4b\u524d\u7684\u5fc5\u9009\u534f\u8c03\u7ec4\u4ef6&#xff0c;\u53ea\u505a\u96c6\u7fa4\u7ba1\u63a7&#xff0c;\u4e0d\u53c2\u4e0e\u6d88\u606f\u8bfb\u5199&#xff1a; \u5b58\u50a8\u96c6\u7fa4\u5143\u6570\u636e&#xff08;Broker\u3001Topic\u3001\u5206\u533a\u3001\u526f\u672c\u3001ISR \u4fe1\u606f&#xff09;\u63d0\u4f9b\u5206\u5e03\u5f0f\u9501\u4e0e\u4e34\u65f6\u8282\u70b9&#xff0c;\u5b9e\u73b0 Kafka Controller \u9009\u4e3e\u611f\u77e5 Broker \u4e0a\u4e0b\u7ebf\u6301\u4e45\u5316\u5206\u533a Leader \u72b6\u6001 Kafka \u53ea\u8d1f\u8d23&#xff1a;\u6d88\u606f\u63a5\u6536\u3001\u5b58\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/80044.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-04T00:17:07+00:00\" \/>\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\/80044.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/80044.html\",\"name\":\"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-04T00:17:07+00:00\",\"dateModified\":\"2026-03-04T00:17:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/80044.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/80044.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/80044.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd\"}]},{\"@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":"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \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\/80044.html","og_locale":"zh_CN","og_type":"article","og_title":"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Kafka ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd \u4e00\u3001\u6574\u4f53\u67b6\u6784 ZooKeeper \u662f Kafka 2.8 \u4e4b\u524d\u7684\u5fc5\u9009\u534f\u8c03\u7ec4\u4ef6&#xff0c;\u53ea\u505a\u96c6\u7fa4\u7ba1\u63a7&#xff0c;\u4e0d\u53c2\u4e0e\u6d88\u606f\u8bfb\u5199&#xff1a; \u5b58\u50a8\u96c6\u7fa4\u5143\u6570\u636e&#xff08;Broker\u3001Topic\u3001\u5206\u533a\u3001\u526f\u672c\u3001ISR \u4fe1\u606f&#xff09;\u63d0\u4f9b\u5206\u5e03\u5f0f\u9501\u4e0e\u4e34\u65f6\u8282\u70b9&#xff0c;\u5b9e\u73b0 Kafka Controller \u9009\u4e3e\u611f\u77e5 Broker \u4e0a\u4e0b\u7ebf\u6301\u4e45\u5316\u5206\u533a Leader \u72b6\u6001 Kafka \u53ea\u8d1f\u8d23&#xff1a;\u6d88\u606f\u63a5\u6536\u3001\u5b58","og_url":"https:\/\/www.wsisp.com\/helps\/80044.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-04T00:17:07+00:00","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\/80044.html","url":"https:\/\/www.wsisp.com\/helps\/80044.html","name":"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-04T00:17:07+00:00","dateModified":"2026-03-04T00:17:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/80044.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/80044.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/80044.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Kafka + ZooKeeper\u67b6\u6784\u57fa\u7840\u4ecb\u7ecd"}]},{"@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\/80044","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=80044"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/80044\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=80044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=80044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=80044"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=80044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}