Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › Apache Kafka

How to Set Up a Multi-Node Kafka Cluster with KRaft on Linux VPS

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A reliable multi-node Kafka deployment on Linux VPS needs two separate failure domains: a KRaft controller quorum for cluster metadata and enough brokers to replicate application data. For a small production installation, use three controllers and three brokers when budget allows, connect controllers over private addresses, format every node with one shared cluster ID, and verify both quorum replication and topic replication before sending real traffic. Three controllers tolerate one controller failure; five tolerate two, because a majority must remain available.

What KRaft changes in a multi-node cluster

KRaft removes ZooKeeper from Kafka’s metadata path. Controllers now form a Raft quorum that stores cluster metadata, elects a leader, and coordinates broker registration, topic configuration, partition assignments, and other control-plane operations. Brokers continue to serve records, but they depend on an available controller majority for metadata changes and normal administration.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That creates two related but distinct designs. The controller quorum protects metadata availability; broker replicas protect the data in your topics. A cluster can have a healthy controller quorum while a topic has under-replicated partitions, or healthy topic replicas while losing the controller majority. Plan and test both layers.

Choose the topology and failure budget first

Controller counts

Controllers Failures tolerated while retaining quorum availability Typical use
Three One controller Small production deployments and most test environments that need high availability
Five Two controllers Higher availability requirements where the extra VPS and replication traffic are justified

A majority of controllers must be alive to maintain availability. Do not run an even number to “split the difference”: four controllers still require three for a majority, while adding another machine increases cost without improving the failure count over three.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Separate roles when possible

The cleanest small production layout is three controller-only VPS nodes and three broker-only VPS nodes. A host failure then removes either metadata capacity or one data-serving broker, not both. Combined controller-and-broker nodes reduce the bill for development or very small workloads, but CPU, memory, disk, and network contention can delay controller elections and broker recovery. Record the failure you intend to tolerate and the recovery time you require before deciding.

Broker replication is a separate decision

Choose a topic replication factor and min.insync.replicas based on tolerated broker failures, usable storage, write latency, network bandwidth, and recovery time. A three-replica topic spread across three brokers has a different capacity and failure profile from the same replication factor spread across six brokers. Internal topics, including consumer offsets and transaction state, also need replication settings appropriate to the number of brokers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the Linux VPS network

Stable names and private controller traffic

Give every VPS a stable hostname or private address that resolves from every controller and broker. Do not put an ephemeral public address in a quorum configuration. The controller endpoint in each voter entry must be reachable from all other Kafka nodes for the entire lifetime of the cluster.

Keep the controller listener on a private network and restrict its firewall port to Kafka nodes. Public client access should terminate at broker listeners only. If clients are outside the private network, expose a broker address deliberately and protect it with TLS or SASL as required by your authentication policy; never expose the controller port as a general client endpoint.

Firewall and port checks

  • Allow the controller port (the example below uses 9093) only between controller and broker private addresses.
  • Allow the broker port (the example uses 9092) from approved producers, consumers, and administration hosts.
  • Permit DNS or equivalent name resolution for every configured hostname.
  • Test both directions between every node pair; one-way reachability produces confusing election and registration failures.

Use your Linux distribution’s firewall and cloud security-group controls together. A process listening on a port is not proof that another VPS can reach it.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Install one Kafka distribution version everywhere

Install the same Kafka distribution and version on every controller and broker. Synchronize a configuration template, but keep node-specific files or overrides for node.id, local listeners, log directories, and advertised broker addresses. The official KRaft documentation is distribution-neutral: it does not prescribe a Linux distribution, VPS provider, CPU or RAM size, or storage class. Select those from workload measurements and provider limits rather than copying a generic hardware number.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use persistent storage, not an ephemeral boot disk, for Kafka data and metadata.
  • Keep sufficient free space for segment rolling, compaction, and recovery.
  • Synchronize time with the operating system’s time service; large clock differences complicate operations and certificate validation.
  • Run Kafka under a dedicated service account whose data directories are not world-readable.

Pick static or dynamic controller membership

Mode Configuration Operational characteristic
Static quorum Every node sets controller.quorum.voters to the same ID-to-endpoint list. Simple to bootstrap; changing membership requires a planned configuration and restart process.
Dynamic quorum Use controller.quorum.bootstrap.servers and omit controller.quorum.voters. Kafka 4.x documentation supports adding and removing controllers through quorum operations after they catch up.

For a first VPS installation, static membership is easier to audit. Dynamic membership is useful when controllers will be added or removed without rebuilding the complete voter list. Do not mix the two modes: a dynamic configuration must not also set the static voter property.

Configure a static three-controller quorum

The following is a pattern, not a copy-and-paste production security policy. Replace names, addresses, directories, and protocols with values that match your network. Every server needs a unique node.id. In a static quorum, every node carries the identical voter list, and each voter ID must match the node.id of its controller.

Controller 1

process.roles=controller
node.id=1
listeners=CONTROLLER://controller-1.example.internal:9093
controller.listener.names=CONTROLLER
[email protected]:9093,[email protected]:9093,[email protected]:9093

Controller 2 and controller 3

Use the same listener name and voter list, changing only the local node.id and local listener endpoint:

# controller-2
process.roles=controller
node.id=2
listeners=CONTROLLER://controller-2.example.internal:9093
controller.listener.names=CONTROLLER
[email protected]:9093,[email protected]:9093,[email protected]:9093

# controller-3
process.roles=controller
node.id=3
listeners=CONTROLLER://controller-3.example.internal:9093
controller.listener.names=CONTROLLER
[email protected]:9093,[email protected]:9093,[email protected]:9093

A controller-only process should not advertise a broker listener. If you intentionally combine roles, declare both roles and provide both listener paths, then account for the resulting resource contention.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Configure the brokers

Each broker receives its own unused node.id and the same controller voter list. The broker listener is for clients and inter-broker traffic; the controller listener remains a separate, private path.

process.roles=broker
node.id=101
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://broker-1.example.internal:9092
controller.listener.names=CONTROLLER
[email protected]:9093,[email protected]:9093,[email protected]:9093
listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT

Set different IDs and advertised names on brokers 2 and 3. Clients use advertised.listeners, not necessarily the bind address in listeners; it must resolve and route correctly from the client network. A hostname that works only on the broker itself will cause clients to connect to the bootstrap server and then fail when Kafka returns unreachable addresses.

The example uses plaintext only to show the wiring. For production, replace it with the approved SSL, SASL_SSL, or other security protocol and configure certificates, credentials, and authorization accordingly. Listener names must be present in listener.security.protocol.map; a typo or missing mapping can prevent startup.

Generate one cluster ID and format every node

KRaft storage formatting creates the metadata files and initial checkpoint that let a node join the cluster. Generate one cluster ID and use that exact value on every controller and broker. Formatting is destructive to the target Kafka data and metadata directories, so stop and verify an empty or disposable directory before proceeding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. On an administration host with the installed Kafka binaries, generate an ID:
    bin/kafka-storage.sh random-uuid

    Save the returned value securely.

  2. Place the node’s intended configuration in its properties file, including its final node.id, roles, listeners, quorum settings, and log directories.
  3. On each VPS, format the configured directories with the same cluster ID and that node’s configuration:
    bin/kafka-storage.sh format -t <cluster-id> -c config/controller.properties
    # On a broker, use its broker properties file instead:
    bin/kafka-storage.sh format -t <cluster-id> -c config/server.properties
  4. Confirm that the command reports successful formatting and that ownership belongs to the Kafka service account.

Do not run formatting as a routine “repair” step on a node containing data you intend to preserve. A mistaken reformat can remove the metadata and log state needed for recovery.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Start the quorum, then the brokers

  1. Start all intended controllers using your service manager or Kafka startup method. Starting the complete planned quorum avoids mistaking a temporary single-node start for a resilient deployment.
  2. Check service logs for listener binding, election, and replication messages. Resolve name, firewall, and storage errors before continuing.
  3. Query the metadata quorum and confirm a leader, the expected voters, and progressing replication.
  4. Start brokers one at a time. Verify that each registers with the controller and that its advertised listener is reachable from an approved client host.
  5. Create or inspect a test topic only after the controller quorum is stable, then perform a producer/consumer smoke test.

Whether you use systemd or another service manager, configure automatic restart carefully. A restart loop can hide a persistent configuration error; retain logs and rate-limit restarts while diagnosing.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify quorum health

Check leader and voter status

bin/kafka-metadata-quorum.sh --bootstrap-controller controller-1.example.internal:9093 describe

Run this with a controller connection configuration when your listener requires authentication. The result should identify a current leader and show the expected voter set. An unavailable majority, changing leadership, or a voter that never catches up indicates a control-plane problem even if broker processes are running.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect metadata replication

bin/kafka-metadata-quorum.sh --command-config config/controller.properties 
  --bootstrap-controller controller-1.example.internal:9093 describe --replication

Use the replication view after startup and after any membership change. Look for followers that are behind, unavailable, or repeatedly disconnecting. Investigate disk latency, packet loss, CPU saturation, and incorrect private addresses before declaring the quorum healthy.

Inspect topic assignments and replicas

bin/kafka-topics.sh --bootstrap-server broker-1.example.internal:9092 
  --describe --topic example

Check that every partition has the intended replicas, a leader, and no under-replicated or offline status. A healthy metadata quorum does not repair a topic whose brokers cannot replicate.

Run a data-plane smoke test

bin/kafka-console-producer.sh --bootstrap-server broker-1.example.internal:9092 --topic example
bin/kafka-console-consumer.sh --bootstrap-server broker-2.example.internal:9092 
  --topic example --from-beginning

Produce a uniquely identifiable test record, consume it from another broker, and verify that client DNS, advertised listeners, authentication, and topic leadership all work. Remove the test topic or records according to your operational policy after validation.

Add controllers with dynamic membership

Kafka 4.x documentation describes dynamic membership through controller.quorum.bootstrap.servers. Include as many controller bootstrap endpoints as possible so a new node can discover the quorum, and omit controller.quorum.voters. Bootstrap addresses are discovery points; they do not replace the quorum’s managed membership.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Prepare the new controller with a unique node.id, its controller listener, the bootstrap server property, and the same cluster ID.
  2. Format its storage with kafka-storage.sh using the existing cluster ID and final configuration.
  3. Start it and monitor catch-up:
    bin/kafka-metadata-quorum.sh --command-config config/controller.properties 
      --bootstrap-controller controller-1.example.internal:9093 describe --replication
  4. After the node has caught up, run the documented add-controller operation for your Kafka version and verify that it appears in quorum status.
  5. Before shutting down a controller permanently, remove it from the quorum using the documented remove operation, wait for the membership change to commit, and only then stop the service.

Never power off a controller first and plan to remove it later: an unplanned loss can reduce the quorum below its majority.

Set replication and durability deliberately

  • Set each user topic’s replication factor high enough for the broker failures you intend to survive.
  • Set min.insync.replicas so acknowledged writes require the intended number of in-sync copies.
  • Configure producers with acknowledgements that require durable writes rather than accepting a response from only the leader’s memory.
  • Assign replication values to consumer-offset and transaction-state internal topics that match the cluster’s broker count and failure objective.
  • Allow for the storage and network cost of every replica, plus temporary overhead during rebalancing and recovery.

Higher durability can increase write latency and reduce available capacity. Measure the workload with your chosen VPS disks and network; there is no universal replication factor for every installation.

Secure listeners, credentials, and files

Use TLS and/or SASL for client and inter-node traffic when the environment requires encryption or authentication. Configure the controller listener separately and keep its firewall scope limited to Kafka nodes. Apply ACLs with the authorizer appropriate to the Kafka version so clients receive only the permissions they need.

Protect private keys, password files, and client properties with filesystem permissions. Do not put secrets in world-readable configuration directories or shell history. Rotate certificates and credentials through an operational process that preserves connectivity for all brokers and controllers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common failures

“No leader” or repeated controller elections

  • Confirm a majority of controller processes is running.
  • Check that every voter ID matches exactly one controller’s node.id.
  • Resolve private DNS, firewall, security-group, and asymmetric routing errors on the controller port.
  • Inspect disk latency and free space; a stalled controller can miss heartbeats even when its process is alive.

Broker starts but clients cannot produce

  • Compare the client’s route to advertised.listeners, not just the broker’s bind address.
  • Verify that the advertised hostname resolves from the client network and that the broker port is allowed.
  • Check listener names and listener.security.protocol.map for spelling and protocol mismatches.
  • Confirm authentication, authorization, and topic ACLs if the listener is secured.

Partitions are under-replicated

  • Use kafka-topics.sh --describe to identify the affected partition and broker.
  • Check the affected VPS’s disk space, I/O latency, JVM or heap pressure, CPU, and packet loss.
  • Do not lower min.insync.replicas reflexively; that can convert a visible availability problem into acknowledged data loss risk.
  • After recovery, verify that replicas catch up and that no offline partitions remain.

A newly added controller never catches up

  • Verify it was formatted with the existing cluster ID, not a newly generated one.
  • Confirm its bootstrap endpoints are reachable and its listener protocol matches the quorum.
  • Inspect metadata replication output and service logs for storage or authentication errors.
  • Only perform the membership-add operation after replication shows that the node is caught up.

Production readiness checklist

  • Controller count and broker count are tied to a written failure budget.
  • Every server has a unique node ID; static voters are identical on all nodes.
  • Controller traffic uses private addresses and a restricted firewall path.
  • One cluster ID was used to format every node, and no data-bearing directory was accidentally reformatted.
  • Controller quorum status shows a stable leader and healthy replication.
  • Topic descriptions show leaders, intended replicas, and no under-replicated or offline partitions.
  • Producer and consumer smoke tests work through the advertised broker addresses.
  • Replication factors, minimum in-sync replicas, producer acknowledgements, and internal-topic settings match the durability objective.
  • Logs, disk latency, free space, JVM pressure, packet loss, and controller elections are monitored.
  • Credentials, private keys, and configuration files are protected and a recovery procedure has been tested.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Apache Kafkadistributed systemsKafka AdministrationKRaftLinux VPS

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.