{"id":9987,"date":"2023-04-17T11:50:37","date_gmt":"2023-04-17T16:50:37","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=9987"},"modified":"2023-04-17T11:50:37","modified_gmt":"2023-04-17T16:50:37","slug":"zookeeper-finding-the-leader","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=9987","title":{"rendered":"Zookeeper: Finding the Leader"},"content":{"rendered":"<p>When restarting our ensemble of zookeepers, I restart the leader last (to avoid repeatedly reallocating the role). Which means I&#8217;ve got to <em>find<\/em> the leader. Luckily the zookeepers are happy to report if they are the leader or a follower if you send &#8216;srvr&#8217; to the zookeeper port.<\/p>\n<pre>jumpserver:~ # echo srvr | nc zcserver38.example.net 2181\r\nZookeeper version: 3.5.8-f439ca583e70862c3068a1f2a7d4d068eec33315, built on 05\/04\/2020 15:53 GMT\r\nLatency min\/avg\/max: 0\/0\/1383\r\nReceived: 3783871\r\nSent: 3784761\r\nConnections: 7\r\nOutstanding: 0\r\nZxid: 0x800003d25\r\nMode: follower\r\nNode count: 3715<\/pre>\n<p>Looking at the &#8220;Mode&#8221; line above, I can see that&#8217;s the follower. So I&#8217;ll check the next Zookeeper &#8230;<\/p>\n<pre>jumpserver:~ # echo srvr | nc zcserver39.example.net 2181\r\nZookeeper version: 3.5.8-f439ca583e70862c3068a1f2a7d4d068eec33315, built on 05\/04\/2020 15:53 GMT\r\nLatency min\/avg\/max: 0\/0\/1167\r\nReceived: 836866\r\nSent: 848235\r\nConnections: 1\r\nOutstanding: 0\r\nZxid: 0x800003d25\r\nMode: leader\r\nNode count: 3715\r\nProposal sizes last\/min\/max: 36\/32\/19782<\/pre>\n<p>And that&#8217;s the leader &#8212; so 39 will be the last one rebooted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When restarting our ensemble of zookeepers, I restart the leader last (to avoid repeatedly reallocating the role). Which means I&#8217;ve got to find the leader. Luckily the zookeepers are happy to report if they are the leader or a follower if you send &#8216;srvr&#8217; to the zookeeper port. jumpserver:~ # echo srvr | nc zcserver38.example.net &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1840],"tags":[1362,1841,1361,1796],"class_list":["post-9987","post","type-post","status-publish","format-standard","hentry","category-zookeeper","tag-apache-kafka","tag-apache-zookeeper","tag-kafka","tag-zookeeper"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9987"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9987\/revisions"}],"predecessor-version":[{"id":9988,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9987\/revisions\/9988"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}