Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ ./bin/kafka-cluster.sh -h
usage: kafka-cluster [-h] {id,decommissionunregister} ...

The Kafka cluster tool.

positional arguments:
  {cluster-id,decommissionunregister}
    cluster-id           Get information about the ID of a cluster.
    unregister  decommission         DecommissionUnregister a broker ID.

optional arguments:
  -h, --help             show this help message and exit

kafka-storage.sh will have two subcommands: id and decommissionunregister.

cluster-id

Code Block
$ ./bin/kafka-cluster.sh cluster-id -h
usage: kafka-cluster cluster-id [-b,-c,-h]

optional arguments:
  -b, --bootstrap-server a list of host/port pairs to use for establishing the connection to the kafka cluster.
  -c, --config           a property file containing configs to be passed to Admin Client.
  -h, --help             show this help message and exit

The ID command prints out the cluster id

...

unregister

Code Block
$ ./bin/kafka-cluster.sh decommissionunregister -h
usage: kafka-cluster decommissionunregister [-h] [--bootstrap-server BOOTSTRAP_SERVER] [--config CONFIG] [--id ID]

optional arguments:
  -h, --help             show this help message and exit
  --bootstrap-server BOOTSTRAP_SERVER, -b BOOTSTRAP_SERVER
                         A list of host/port pairs to use for establishing the connection to the kafka cluster.
  --config CONFIG, -c CONFIG
                         A property file containing configs to passed to AdminClient.
  --id ID, -i ID         The ID of the broker to decommissionunregister.

The decommission command removes the registration of a specific broker ID.  It will use make a DecommissionBrokerRequest an UnregisterBrokerRequest in order to do this.

Configurations

...

There will be a new AdminClient RPC, decommissionBrokerunregisterBroker.

Code Block
languagejs
DecommissionBrokerResultUnregisterBrokerResult decommissionBrokerunregisterBroker(int brokerId, DecommissionBrokerOptionsUnregisterBrokerOptions options)

public class DecommissionBrokerResultUnregisterBrokerResult {
    public KafkaFuture<Void> all();
}

public class DecommissionBrokerOptionsUnregisterBrokerOptions extends AbstractOptions<DecommissionBrokerOptions>AbstractOptions<UnregisterBrokerOptions> {
}

RPCs

Obsoleting the Metadata Propagation RPCs

...

The controller will return NOT_CONTROLLER if it is not active.  Brokers will always return NOT_CONTROLLER for these RPCs.

...

UnregisterBroker

Required ACLs: ALTER on CLUSTER

The DecomissionBrokerRequest UnregisterBrokerRequest asks the controller to unregister a broker from the cluster.

Code Block
languagejs
{
  "apiKey": 59,
  "type": "request",
  "name": "DecommissionBrokerRequestUnregisterBrokerRequest",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "BrokerId", "type": "int32", "versions": "0+",
      "about": "The broker ID to decommissionunregister." }
  ]
}   

{
  "apiKey": 59,
  "type": "response",
  "name": "DecommissionBrokerResponseUnregisterBrokerResponse",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
      "about": "Duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." }
    { "name": "ErrorCode", "type": "int16", "versions": "0+",
      "about": "The error code, or 0 if there was no error." },
  ]
}

The valid response codes are:

  • NONE if the decommissioning unregistration succeeded or if the broker was already decommissionedunregistered.
  • NOT_CONTROLLER if the node that the request was sent to is not the controller
  • UNSUPPORTED_VERSION if KIP-500 mode is not enabled

...