Kafka - Kubernetes and Cloud DeploymentWhich of the following is the correct syntax to set the number of partitions for a Kafka topic using the CLI?Akafka-topics.sh --alter --topic myTopic --partitions 10 --bootstrap-server localhost:9092Bkafka-topics.sh --create --topic myTopic --partitions=10 --zookeeper localhost:2181Ckafka-topics.sh --delete --topic myTopic --partitions 10 --bootstrap-server localhost:9092Dkafka-topics.sh --list --topic myTopic --partitions 10 --zookeeper localhost:2181Check Answer
Step-by-Step SolutionSolution:Step 1: Identify the command to alter partitionsTo change partitions, use --alter with --partitions option.Step 2: Check the correct syntax for altering partitionskafka-topics.sh --alter --topic myTopic --partitions 10 --bootstrap-server localhost:9092 uses --alter, --topic, --partitions, and --bootstrap-server correctly.Final Answer:kafka-topics.sh --alter --topic myTopic --partitions 10 --bootstrap-server localhost:9092 -> Option AQuick Check:Alter partitions syntax = kafka-topics.sh --alter --topic myTopic --partitions 10 --bootstrap-server localhost:9092 [OK]Quick Trick: Use --alter to change partitions, not --create or --delete [OK]Common Mistakes:Using --create to set partitions after topic creationUsing --delete or --list with partitions optionMixing --zookeeper and --bootstrap-server incorrectly
Master "Kubernetes and Cloud Deployment" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Advanced Stream Processing - Exactly-once stream processing - Quiz 13medium Advanced Stream Processing - State stores - Quiz 12easy Event-Driven Architecture - Saga pattern for distributed transactions - Quiz 8hard Multi-Datacenter and Replication - Active-passive vs active-active - Quiz 4medium Multi-Datacenter and Replication - Disaster recovery planning - Quiz 4medium Performance Tuning - Producer throughput optimization - Quiz 6medium Security - Client authentication configuration - Quiz 12easy Security - Security best practices - Quiz 5medium Security - Client authentication configuration - Quiz 8hard Security - Why securing Kafka protects data - Quiz 14medium