Bird
0
0

Identify the error in this Kafka leader election configuration snippet:

medium📝 Debug Q6 of 15
Kafka - Cluster Architecture
Identify the error in this Kafka leader election configuration snippet:
broker.id = 2
zookeeper.connect=localhost:2181
controller.quorum.voters=1@localhost:9093,2@localhost:9094
Abroker.id should not have spaces around '='
Bbroker.id must be a string, not a number
Ccontroller.quorum.voters format is incorrect
Dzookeeper.connect is deprecated and should be removed
Step-by-Step Solution
Solution:
  1. Step 1: Check broker.id syntax

    Spaces around '=' are allowed in properties files, so no error here.
  2. Step 2: Review zookeeper.connect usage

    In newer Kafka versions with KRaft mode, zookeeper.connect is deprecated and should be removed.
  3. Step 3: Validate controller.quorum.voters format

    The format 'id@host:port' is correct for controller quorum voters.
  4. Final Answer:

    zookeeper.connect is deprecated and should be removed -> Option D
  5. Quick Check:

    Deprecated config = zookeeper.connect [OK]
Quick Trick: Remove deprecated zookeeper.connect in KRaft mode [OK]
Common Mistakes:
  • Thinking spaces cause error in properties
  • Misreading controller quorum voters format
  • Assuming broker.id must be string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes