Versions Compared

Key

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

Table of Contents

Status

Current stateUnder Discussion

...

JIRA:

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKAFKA-15471

Motivation

Some users run KRaft controllers and brokers on the same machine (not containerized, but through tarballs, etc).  Prior to KRaft, when running ZooKeeper and Kafka on the same machine, users could independently stop the ZooKeeper node and Kafka broker since there were specific shell scripts for each (zookeeper-server-stop and kafka-server-stop, respectively).

However in KRaft mode, they can't stop the KRaft controllers independently from the Kafka brokers or any independent process because there is just a single script that doesn't distinguish between the two processes and signals both all of them. We need to provide a way for users to kill either controllers or brokers, and more specificallyeven better, individual controller or broker when there are multiple of themany individual process.

Public Interfaces

The command line for stopping Kafka nodes will include a new optional parameter ("[--required-config <name=value>]") to support (1) identifying a specific process (2) identifying a specific node ID to stop based on the contents of the node's configuration file.

...

The new script will accept an optional parameter "[--required-config <name=value>]", and <name> can take either "process.roles" or "node.id"with name indicating any fields in the configuration file, to indicate that the script should only kill Kafka processes that are running with that value for the config field.

Example 1: the new command to kill all the broker processes will look like:

...

When a "required-config" field is not provided, the behavior remains unchanged -- all Kafka processes are stopped.

Proposed Changes

I'm changing the "kafka-server-stop.sh" file to accept an optional field, required-config. When the user specify a process role / node ID"name"(a specific field in the configuration file), I will retrieve the absolute path to the configuration file, and search for the value of "process.roles / node.id". that field. If the value retrieved from the configuration file matches the input, that process will be killed, otherwise it will be skipped.

NOTE: If users want to use the feature, they have to provide an absolute path to the configuration file when starting a Kafka controller/broker process. 

Compatibility, Deprecation, and Migration Plan

Existing users won't need to change any behavior if they want to continue killing both controller and broker processes. Otherwise, if they want to kill only the broker/controller, or an individual broker/controller, they'll need to specify a "required-config" field with "<process-roles = value>" or "<node.id <name = value>" in the script.

Test Plan

The change can be tested through command line. 

...