Bird
0
0

Which command correctly creates a Kafka topic named orders with 3 partitions and replication factor 2?

easy📝 Syntax Q12 of 15
Kafka - Topics and Partitions
Which command correctly creates a Kafka topic named orders with 3 partitions and replication factor 2?
Akafka-topics.sh --create --topic orders --partitions 3 --replication-factor 2 --bootstrap-server localhost:9092
Bkafka-create-topic orders 3 2
Ccreate-topic --name orders --partitions 3 --replicas 2
Dkafka-topics.sh --new --topic orders --partitions=3 --replicas=2
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct Kafka topic creation syntax

    The official command uses kafka-topics.sh with --create, --topic, --partitions, --replication-factor, and --bootstrap-server options.
  2. Step 2: Match options with correct syntax

    kafka-topics.sh --create --topic orders --partitions 3 --replication-factor 2 --bootstrap-server localhost:9092 matches the correct syntax exactly; others use wrong commands or options.
  3. Final Answer:

    kafka-topics.sh --create --topic orders --partitions 3 --replication-factor 2 --bootstrap-server localhost:9092 -> Option A
  4. Quick Check:

    Correct syntax = kafka-topics.sh --create --topic orders --partitions 3 --replication-factor 2 --bootstrap-server localhost:9092 [OK]
Quick Trick: Use kafka-topics.sh with --create and proper flags [OK]
Common Mistakes:
  • Using wrong command names
  • Missing --bootstrap-server option
  • Incorrect option names like --replicas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes