{"id":9721,"date":"2023-01-05T23:16:36","date_gmt":"2023-01-06T04:16:36","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=9721"},"modified":"2023-04-17T11:45:48","modified_gmt":"2023-04-17T16:45:48","slug":"kafka-finding-the-controller-in-zookeeper","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=9721","title":{"rendered":"Kafka: Finding the Controller in Zookeeper"},"content":{"rendered":"<p>When restarting all of the Kafka servers (e.g. a periodic patch and reboot), it is better if you avoid rolling the controller between the nodes on every reboot. To accomplish this goal, find out which server is acting as the controller and restart it <em>last<\/em> &#8212; you&#8217;ll have the controller move one time using this method, but <em>only<\/em> once no matter how many servers are in your deployment.<\/p>\n<pre># Connect to zookeeper\r\n.\/zookeeper-shell.sh localhost:2181\r\n# Find controller by opening the zookeeper shell and querying for controller\r\nget \/controller\r\n{\"version\":1,\"brokerid\":250,\"timestamp\":\"1676694139851\"}\r\n\r\n# Get details on broker ID reported as controller\r\nget \/brokers\/ids\/250\r\n{\"listener_security_protocol_map\":{\"PLAINTEXT\":\"PLAINTEXT\",\"SASL_PLAINTEXT\":\"SASL_PLAINTEXT\"},\"endpoints\":[\"PLAINTEXT:\/\/kafkahost.example.net:9093\",\"SASL_PLAINTEXT:\/\/kafkahost.example.net:9092\"],\"jmx_port\":9999,\"host\":\"kafkahost.example.net\",\"timestamp\":\"1676348503278\",\"port\":9093,\"version\":4}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When restarting all of the Kafka servers (e.g. a periodic patch and reboot), it is better if you avoid rolling the controller between the nodes on every reboot. To accomplish this goal, find out which server is acting as the controller and restart it last &#8212; you&#8217;ll have the controller move one time using this &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1762],"tags":[1361,1796],"class_list":["post-9721","post","type-post","status-publish","format-standard","hentry","category-kafka","tag-kafka","tag-zookeeper"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9721","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=9721"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9721\/revisions"}],"predecessor-version":[{"id":9986,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9721\/revisions\/9986"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}