Bird
0
0

Which of the following is the correct way to set the replication factor when creating a Kafka topic using the command line?

easy📝 Syntax Q12 of 15
Kafka - Cluster Architecture

Which of the following is the correct way to set the replication factor when creating a Kafka topic using the command line?

kafka-topics.sh --create --topic my-topic --partitions 3 --replication-factor ? --bootstrap-server localhost:9092
A--replication-factor 3
B--replication-factor=3
C--replication_factor 3
D--replicationFactor 3
Step-by-Step Solution
Solution:
  1. Step 1: Check Kafka CLI syntax for replication factor

    The correct flag is --replication-factor with a space before the value.
  2. Step 2: Identify incorrect options

    Options with underscores or camelCase are invalid flags; equals sign is not used here.
  3. Final Answer:

    --replication-factor 3 -> Option A
  4. Quick Check:

    Use double dash and hyphen for replication factor [OK]
Quick Trick: Use double dash and hyphen for flags in Kafka CLI [OK]
Common Mistakes:
  • Using underscore instead of hyphen
  • Using equals sign instead of space
  • Using camelCase flag names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes