How can I restart kafka-manager safely with out kill command?

2.8k Views Asked by At

my kafka-manager can't update consumer information and keeps the removed consumer groups list, so i try to restart kafka-manager. (i'm using kafka-manager 1.3.3.22 and kafka 2.12-2.1.1)

but README.md in kafka-manager and /bin/kafka-manager command doesn't appear to provide stop/restart.

is there any way to safely restart or terminate kafka-manager? without 'kill -9 PID' commend

1

There are 1 best solutions below

0
Giorgos Myrianthous On BEST ANSWER

There is no restart command out of the box however, you can run Kafka Manager as a service.


Firstly, create the service file under /etc/systemd/system/kafka-manager.service and add the following content:

[Unit]
Description=Kafka Manager
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
ExecStart=/opt/kafka-manager-1.3.3.22/bin/kafka-manager
Type=simple

In /opt/kafka-manager-1.3.3.22/conf/application.conf:

play.crypto.secret="some-secret"
play.http.requestHandler="play.http.DefaultHttpRequestHandler"
play.application.loader=loader.KafkaManagerLoader
pinned-dispatcher.type="PinnedDispatcher"
pinned-dispatcher.executor="thread-pool-executor"
kafka-manager.zkhosts="my-zookeeper-connection-string"
kafka-manager.base-zk-path="/a-chroot"

In /opt/kafka-manager-1.3.3.22/conf/application.ini:

-Dapplication.home=/opt/kafka-manager-1.3.3.22
-Dpidfile.path=/opt/kafka-manager-1.3.3.22/kafka-manager.pid
-Dhttp.port=8080

and finally run

systemctl daemon-reload
systemctl enable kafka-manager --now

Start the service

systemctl start kafka-manager.service

Stop the service

systemctl stop kafka-manager.service

Restart the service

systemctl restart kafka-manager.service