Unix job control for Kafka processes¶
The standard command for starting a Kafka broker is kafka-server-start.sh, which accepts the server configuration file (typically server.properties) as an argument.^[600-developer-big-data-kafka-kafka-01.md]
Because the startup process occupies the terminal, Unix job control commands can be used to manage it.^[600-developer-big-data-kafka-kafka-01.md]
Execution workflow¶
To start the broker, run the server script.^[600-developer-big-data-kafka-kafka-01.md]
bin/kafka-server-start.sh config/server.properties
Once the process is running, you can manage it directly in the shell using the following steps^[600-developer-big-data-kafka-kafka-01.md]:
- Suspend the process: Press
Ctrl + Zto pause the foreground process. - Resume in background: Execute
bgto resume the suspended process in the background. - Verify status: Run
jobs -lto list active background jobs. - Bring to foreground: If needed, use
fg %1(where1is the job number) to bring the specific background job back to the foreground.
Process termination¶
To gracefully shut down the Kafka broker, use the dedicated stop script provided by the Kafka binaries.^[600-developer-big-data-kafka-kafka-01.md]
bin/kafka-server-stop.sh
Related Concepts¶
- [[Kafka]]
- [[Unix job control]]
- [[Process management]]
Sources¶
^[600-developer-big-data-kafka-kafka-01.md]