Versions Compared

Key

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

...

Current stateUnder Discussion

Discussion thread: Image Removedhttps://confluent.slack.com/archives/C021W3ULE2X/p1690905387380699 

JIRA: KMETA-1086

Motivation

Some users run KRaft controllers and brokers on the same machine (not containerized, but through tarballs, etc) and with ZooKeeper, they can independently start/.  Prior to KRaft, when running ZooKeeper and Kafka on the same machine, users could independently stop the ZooKeeper controller 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 start and stop the KRaft controller independently from the Kafka broker 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.

Public Interfaces

The command line for killing controllers/brokers will changestopping Kafka nodes will include a new optional parameter to support identifying a specific process to stop based on the contents of the node's configuration file (specifically, the process.roles value).

Instead of simply running 

Code Block
./bin/kafka-server-stop.sh

The proposed change include adding an extra optional field "process-role", which specify the specific process the user want to kill, i.e, controller/brokernew script will accept an optional parameter "--process.roles <value>" to indicate that the script should only kill Kafka processes that are running with that value for the config. For example, the new command to kill broker only will look like:

Code Block
./bin/kafka-server-stop.sh --process-role broker

...

process

...

Code Block
Killed broker with PID 69194
Skip killing controller with PID 69039.roles broker

When a "process-role .roles" field is not provided, the command killed both controllers and brokersbehavior remains unchanged -- all Kafka processes are stopped.

Proposed Changes

I'm changing the "kafka-server-stop.sh" file to accept an optional field, process role. When the user specify a process role, I will retrieve the absolute path to the configuration file, and search for the value of "process.roles". If the "process.roles" from the configuration file matches the process role the user provided, that process will be killed, otherwise it will be skipped.

...