You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Status

Current stateUnder Discussion

Discussion thread: https://lists.apache.org/thread/mwcljxdnyobthsszy4n2qr2tqcf9cxcf

JIRA: Unable to render Jira issues macro, execution error.

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 processes and signals all of them. We need to provide a way for users to kill either controllers or brokers, and even better, any individual process.

Public Interfaces

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

Instead of simply running 

./bin/kafka-server-stop.sh

The new script will accept an optional parameter "[--required-config <name=value>]", 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:

./bin/kafka-server-stop.sh --required-config process.roles=broker

Example 2: the command to kill the process with node ID = 1 will look like:

./bin/kafka-server-stop.sh --required-config node.id=1

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 "name"(a specific field in the configuration file), I will retrieve the absolute path to the configuration file, and search for the value of 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 "<name = value>" in the script.

Test Plan

The change can be tested through command line. 


  • No labels