Three-broker Kafka clusters
A three-broker cluster runs three Kafka brokers on three different hosts. By default every topic is kept on all three. With acks=all, which current clients use by default, a write is acknowledged only once at least two of the three brokers have it, so the cluster keeps serving when one broker fails, and while one restarts. Clients may see brief errors while partition leaders move to another broker, and should retry.
It is in early access, and this page is shown only to accounts that have it enabled. Everything in the Managed Kafka guide applies to a three-broker cluster too, except where this page says otherwise.
What it costs
A plan is the size of one broker. A three-broker cluster costs three times the plan, billed hourly like everything else. On the smallest plan a three-broker cluster has three vCPU, six GB of RAM and three 25 GB disks.
Create one
In the console, choose Three brokers under Brokers when you create the cluster. With the API, send "broker_count": 3 to POST /api/v1/queue together with "provider": "kafka".
The number of brokers is fixed when the cluster is created. To move from one broker to three, create a new cluster and copy your data with a tool you run yourself, such as MirrorMaker 2, or by producing again from your source. DanubeData does not copy data between clusters, and consumer group offsets and Schema Registry schemas are not carried over.
A three-broker cluster's name is at most 23 characters, fewer when your project's name is long. A new cluster named like another cluster followed by a dash, a b and a number (for example orders-b1 next to a three-broker orders) is refused, and a three-broker cluster cannot be created while a cluster named like one of its brokers exists.
Connecting
You use the same bootstrap server, kafka-<name>-<project>.queues.danubedata.ro:<port>, and the same SASL settings. The cluster tells your client to connect to each broker by its own name, b0-kafka-<name>-<project>.queues.danubedata.ro, and likewise b1- and b2-, on the same port. The certificate covers all of them.
The cluster tells the connections apart by the server name in the TLS handshake. Current Java clients, librdkafka (and the clients built on it, such as kcat and the Python, Go and .NET ones) and KafkaJS send it. A client that sends none is connected to an arbitrary broker, so a request for a partition can reach a broker that does not lead it and fail.
Topics
A new topic has three copies unless you choose otherwise, and three is what we recommend. The cluster requires two of a topic's copies to be in sync for a write that asks every replica to acknowledge it, so:
- Three copies keep taking writes when one broker is down.
- Two copies stop taking such writes while either of the two brokers that hold them is down.
- One copy needs its own
min.insync.replicasof 1, and is unavailable while its broker is down.
The API refuses a topic with one copy and no min.insync.replicas of 1, and a topic with more copies than the cluster has brokers. Kafka Studio creates topics with the cluster's default of three copies.
When a broker is down
The cluster stays Running and your clients keep working. The Brokers tab shows which broker is not ready, and the cluster page warns you.
While a broker is down:
- a version update waits until all three are up;
- creating a topic with the default number of copies fails, and so does the first use of consumer groups or of transactions on the cluster, because Kafka creates its internal topics with three copies on first use;
- turning the Schema Registry on for the first time fails or stays not ready, because it needs a topic with three copies.
Another failure while one broker is already down stops writes until a second broker is back. With two brokers down the cluster's status may change to Provisioning or Error, and the page keeps listing which brokers are not ready. Look at the cluster when you see the warning.
Not available yet
- Snapshots, automated daily backups and restore. Your topics are kept on all three brokers, so they survive the loss of one, but a deleted topic is deleted on all three.
- Stopping and starting the cluster, and changing its plan.
- Replacing a broker whose host is lost for good. If that happens, create a new cluster and copy your data over.