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

Compare with Current View Page History

« Previous Version 16 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 because there is just a single script that doesn't distinguish between the two processes and signals both of them. We need to provide a way for users to kill either controllers or brokers, and more specifically, individual controller or broker when there are multiple of them.

Public Interfaces

The command line for stopping Kafka nodes will include a new optional parameter ("required-config") 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.

Instead of simply running 

./bin/kafka-server-stop.sh

The new script will accept an optional parameter "[--required-config <name=value>]", and <name> can take either "process.roles" or "node.id", to indicate that the script should only kill Kafka processes that are running with that value for the config.
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 process role / node ID, I will retrieve the absolute path to the configuration file, and search for the value of "process.roles / node.id". 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 = value>" in the script.

Test Plan

The change can be tested through command line. 


  • No labels