1

Currently, we don't have much load on Kafka. But we expect some decent load in the future. Hence for the cost-cutting reasons, we are planning to have Kafka stack with only one node (One Zookeeper and one Kafka Broker) for the time being and later based on the load we would like to make it a proper cluster (with 3 nodes at least).

Is it ok to start this way (starting with one node and then adding more nodes).

I read somewhere that it can't be done in a seamless fashion. Can someone explain what can go wrong if not?

1 Answer 1

2

You will need downtime to stop Zookeeper + Kafka, edit the configurations to include more servers, then start them back up. In those terms, it is not seamless, as there will be service outages for apps reading/writing. But once everything is started again, those should be okay.

Outside of a local environment, it is definitely recommended to start with at least 3 Zookeepers, even if you have only one broker. A failure of just that one Zookeeper server would be really bad for Kafka... And it is also recommended to have at least 3 brokers for replication and fault-tolerance, despite how much load you have. Having at least one copy of the data is better than none at all.

You do not need to scale Zookeeper evenly with Kafka; e.g. 3 ZK + 1 brokers, then add more brokers later, and don't go more than 5-7 Zookeepers for large clusters.

Sign up to request clarification or add additional context in comments.

2 Comments

If we go with 3ZK and 1 Broker and later introduce one more broker, what happens to the data on the already existing broker. will it be distributed evenly? can we change the replication factor after adding the new broker?
All existing data will stay on the first broker. Both operations of rebalancing and adding replicas must be performed manually. kafka.apache.org/documentation/#basic_ops_cluster_expansion Or you can find external tools to make that more automated/scriptable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.