Bird
Raised Fist0
Kafkadevops~10 mins

Standalone vs distributed mode in Kafka - Interactive Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a Kafka broker in standalone mode.

Kafka
bin/kafka-server-start.sh config/server[1].properties
Drag options to blanks, or click blank then click option'
A1
Bstandalone
Cdistributed
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'distributed' or 'standalone' as part of the filename causes errors.
Omitting the number leads to missing configuration.
2fill in blank
medium

Complete the code to start multiple Kafka brokers in distributed mode.

Kafka
bin/kafka-server-start.sh config/server[1].properties
Drag options to blanks, or click blank then click option'
Adefault
Bstandalone
C2
Dsingle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'standalone' instead of a number causes startup failure.
Using 'default' does not specify a broker number.
3fill in blank
hard

Fix the error in the command to start Kafka in distributed mode.

Kafka
bin/kafka-server-start.sh config/server[1].properties
Drag options to blanks, or click blank then click option'
Asingle
Bdefault
Cstandalone
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'standalone' or 'default' instead of a number causes errors.
Omitting the broker number leads to wrong configuration.
4fill in blank
hard

Fill both blanks to configure Kafka for distributed mode with correct broker ID and port.

Kafka
broker.id=[1]
port=[2]
Drag options to blanks, or click blank then click option'
A2
B9093
C9092
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same broker ID for multiple brokers causes conflicts.
Using the default port 9092 for all brokers causes port conflicts.
5fill in blank
hard

Fill all three blanks to create a Kafka producer command for standalone and distributed modes.

Kafka
bin/kafka-console-producer.sh --broker-list localhost:[1] --topic [2] --producer-property acks=[3]
Drag options to blanks, or click blank then click option'
A9092
Btest-topic
Call
D9093
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 9092 for distributed mode causes connection issues.
Setting acks to '0' or '1' may cause message loss.

Practice

(1/5)
1. What is the main purpose of running Kafka Connect in standalone mode?
easy
A. To run multiple workers for high scalability
B. To run Kafka Connect in a single process for simple or testing use
C. To enable fault tolerance across multiple machines
D. To connect Kafka with distributed databases automatically

Solution

  1. Step 1: Understand standalone mode context

    Standalone mode runs Kafka Connect in one process, suitable for simple or testing scenarios.
  2. Step 2: Compare with distributed mode

    Distributed mode runs multiple workers for scalability and fault tolerance, unlike standalone mode.
  3. Final Answer:

    To run Kafka Connect in a single process for simple or testing use -> Option B
  4. Quick Check:

    Standalone mode = single process for testing [OK]
Hint: Standalone = single process, simple use [OK]
Common Mistakes:
  • Confusing standalone with distributed mode
  • Thinking standalone supports fault tolerance
  • Assuming standalone is for large scale pipelines
2. Which of the following is the correct command to start Kafka Connect in distributed mode?
easy
A. kafka-connect.sh start-standalone
B. connect-standalone.sh config/connect-standalone.properties
C. kafka-connect.sh start-distributed
D. connect-distributed.sh config/connect-distributed.properties

Solution

  1. Step 1: Identify the script for distributed mode

    The script connect-distributed.sh is used to start Kafka Connect in distributed mode.
  2. Step 2: Confirm the configuration file

    The configuration file config/connect-distributed.properties is the standard config for distributed mode.
  3. Final Answer:

    connect-distributed.sh config/connect-distributed.properties -> Option D
  4. Quick Check:

    Distributed mode uses connect-distributed.sh [OK]
Hint: Distributed mode uses connect-distributed.sh script [OK]
Common Mistakes:
  • Using connect-standalone.sh for distributed mode
  • Mixing config files between modes
  • Assuming kafka-connect.sh is a valid command
3. Given the following scenario: You start Kafka Connect with connect-standalone.sh and add two connectors. What will happen if the process crashes?
medium
A. Both connectors will automatically restart on another worker
B. Connectors will continue running without interruption
C. The connectors will stop and require manual restart
D. Kafka Connect will switch to distributed mode automatically

Solution

  1. Step 1: Understand standalone mode fault tolerance

    Standalone mode runs in a single process without fault tolerance or automatic recovery.
  2. Step 2: Consequence of process crash

    If the process crashes, connectors stop and need manual restart because no other worker is available.
  3. Final Answer:

    The connectors will stop and require manual restart -> Option C
  4. Quick Check:

    Standalone mode lacks automatic recovery [OK]
Hint: Standalone mode needs manual restart after crash [OK]
Common Mistakes:
  • Assuming automatic failover in standalone mode
  • Thinking distributed mode starts automatically
  • Believing connectors run independently of the process
4. You configured Kafka Connect in distributed mode but notice that only one worker is running and no failover happens. What is the likely cause?
medium
A. You started Kafka Connect with connect-standalone.sh instead of connect-distributed.sh
B. You did not configure the Kafka cluster correctly
C. You forgot to add connectors to the worker
D. Distributed mode does not support multiple workers

Solution

  1. Step 1: Check the startup script used

    If connect-standalone.sh is used, only one worker runs without failover, even if config is for distributed mode.
  2. Step 2: Understand distributed mode requirements

    Distributed mode requires starting with connect-distributed.sh to run multiple workers and enable failover.
  3. Final Answer:

    You started Kafka Connect with connect-standalone.sh instead of connect-distributed.sh -> Option A
  4. Quick Check:

    Wrong startup script causes single worker [OK]
Hint: Use connect-distributed.sh to run multiple workers [OK]
Common Mistakes:
  • Assuming config alone enables distributed mode
  • Believing distributed mode runs with standalone script
  • Ignoring startup script importance
5. You have a data pipeline that must handle high volume and remain available even if one worker fails. Which Kafka Connect mode should you choose and why?
hard
A. Distributed mode, because it supports multiple workers and fault tolerance
B. Standalone mode, because it is simpler to configure
C. Standalone mode, because it automatically restarts connectors on failure
D. Distributed mode, because it runs connectors in a single process

Solution

  1. Step 1: Analyze pipeline requirements

    High volume and availability require scalability and fault tolerance.
  2. Step 2: Match requirements to Kafka Connect modes

    Distributed mode runs multiple workers and supports fault tolerance, meeting these needs.
  3. Final Answer:

    Distributed mode, because it supports multiple workers and fault tolerance -> Option A
  4. Quick Check:

    High volume + fault tolerance = distributed mode [OK]
Hint: Choose distributed mode for scalability and fault tolerance [OK]
Common Mistakes:
  • Choosing standalone for high availability
  • Thinking standalone auto-restarts connectors
  • Misunderstanding distributed mode runs single process
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard