Reputation: 3777
I have got Kafka working (using Docker image) on a single server where I have got Zookeeper + Kafka Broker on the same/one Server X.
If I need to additional broker on Server Y (for resiliency), do i need to deploy Kafka Broker on server Y and point to the same Zookeeper on Server X?
Or do i need to deploy Zookeeper on Server Y as well? if so, how i get both Zookeepers discover each other ?
Upvotes: 1
Views: 85
Reputation: 191738
how i get both Zookeepers discover each other ?
You'd set the ZOOKEEPER_SERVERS
variable to point at each ZK
do i need to deploy Kafka Broker on server Y and point to the same Zookeeper on Server X?
For resiliency, yes. You would use KAFKA_ZOOKEEPER_CONNECT
to point the brokers at the ZK cluster.
Note: KAFKA_ADVERTISED_LISTENERS
will need configured to return the external network address of both servers rather than only localhost
or the Docker image service name for clients to work. Similarly, the inter-broker listener will need configured so that topic replication will work.
Note (2): You will want persistent volume mounts to preserve ZK and Kafka data from containers.
Upvotes: 1