1

I am wondering is there any way to make the zookeeper failover for kafka cluster. For example: i want to setup 2 zookeeper instances for my kafka cluster. In case of one zookeeper fails, Kafka servers still able to read metadata of topics from second zookeeper.

any advice is highle appricicated.

Joey Trang
  • 1,105
  • 2
  • 23
  • 44

2 Answers2

4

Zookeeper works as a so-called quorum – a cluster of nodes that forms a consensus based on simple majority votes.

For production, you should use 3 or 5 Zookeeper instances in a quorum. If you're using 3, your cluster can survive losing one server (because the remaining two form a simple majority). With 5, you can lose two servers because 3 is a majority of 5.

2 is a bad idea because your cluster won't work if 1 node goes down.

Please check this question

Community
  • 1
  • 1
ftr
  • 2,105
  • 16
  • 29
2

$KAFKA_HOME/config/server.properties

Here you can set multiple zookeeper

zookeeper.connect=<server1>:2181,<server2>:2181,<server2>:2181

Maintain 2n+1(quorum ) rule in case of zookeeper

ketankk
  • 2,578
  • 1
  • 29
  • 27