DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Currently, when using MetadataQuorumCommand to add a controller, users must provide a controller.properties configuration file. This file is required for the command to retrieve the metadata local path and endpoints needed to add voters. However, this approach has several limitations:
...
The kafka-metadata-quorum.sh tool introduces a new option —-controller-id for the add-controller subcommand.
Adding a controller
This can only be done with bootstrap controller option since we can‘t use bootstrap.server in Admin#describeConfigs to get controller configs.
| Code Block | ||||
|---|---|---|---|---|
| ||||
bin/kafka-metadata-quorum.sh --bootstrap-controller localhost:9093 add-controller --controller-id <id> |
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
diff --git a/tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java b/tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java
index dba7951aa4..f3bdbbeffa 100644
--- a/tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java
+++ b/tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java
@@ -471,7 +471,6 @@ public class MetadataQuorumCommand {
removeControllerParser
.addArgument("--controller-directory-id", "-d")
.help("The directory ID of the controller to remove.")
- .required(true)
.action(Arguments.store()); |
The
—-controller_directory-idis no longer required. We can useAdmin#describeMetadataQuorummethod to get the controller directory UUID.If
—-controller_directory-idis explicitly provided, it will be used directly, andAdmin#describeMetadataQuorumwill not be called.
Compatibility, Deprecation, and Migration Plan
This change should be backward compatible:
The
—-command-configoption remains available inadd-controller.The
--controller-directory-idoption inremove-controlleris now optional but still supported.
Test Plan
New test cases will be added to MetadataQuorumCommandTest.java to validate:
Adding a controller with
--controller-id.Removing a controller without explicitly providing
--controller-directory-id.
Rejected Alternatives
N/A