简体   繁体   English

关闭Kafka群集,然后启动Kafka群集

[英]Shutdown Kafka Cluster and then Start Kafka Cluster

I have a 2 Broker node kafka with 3 node ZooKeeper cluster. 我有一个2 Broker节点kafka和3节点ZooKeeper集群。 When Stopping and starting Kafka cluster, what are the steps I should take, Do I go, stop 2 brokers individually first and then stop 3 zks individually? 在停止和启动Kafka集群时,我应该采取什么步骤?我应该先分别停止2个代理,然后分别停止3个zks吗? And then start zks individually and 2 kafka brokers individually? 然后分别启动zks和2个kafka经纪人?

Assumptions 假设条件

  • This is a production cluster and you don't want any data loss. 这是一个生产集群,您不希望丢失任何数据。
  • You have partition replicas spanned across the brokers 您具有跨代理分布的分区副本
  • For each partition you have at least one replica on each broker 对于每个分区,每个代理上至少有一个副本
  • all zks are accessible by each broker 每个经纪人都可以访问所有zks

This is how I would do it 这就是我会做的

  1. Take down individual broker. 取消个人经纪人。
  2. When one of the broker is down, then describe the topics to check if only replicas that are not shown, belong to broker which was taken down. 当其中一个代理关闭时,请describe主题以检查是否只有未显示的副本属于已关闭的代理。
  3. Restart the broker and again verify that all partitions are in sync before going for next broker. 重新启动代理,然后再次验证所有分区是否同步,然后再寻找下一个代理。
  4. Then stop-start each zk individually, each time tracking if all replicas and partitions are in sync. 然后分别停止启动每个zk,每次跟踪所有副本和分区是否同步。 That way at least one zk is available for 2 brokers to maintain their meta data 这样,至少有一个zk可用于2个经纪人来维护其元数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM