How to restart kafka server properly?
Asked Answered
P

2

16

Every time I stop the kafka server and start it again it doesn't start properly and I have to restart my whole machine and start the kafka server. Does anybody know how I can restart kafka server without having to restart my machine? Actually I would like to terminate the consumer from last session.

Thank you,

Zeinab

Peyton answered 19/7, 2018 at 17:14 Comment(0)
V
20

If your Kafka broker is running as a service (found under /lib/systemd/system/) from a recent Confluent Platform release, you can stop it using:

systemctl stop confluent-kafka.service

or if you'd like to restart the service,

systemctl restart confluent-kafka.service

Otherwise, you can stop your broker using

./bin/kafka-server-stop.sh

and re-start it:

./bin/kafka-server-start.sh config/server.properties

If you want to stop a specific consumer, simply find the corresponding process id:

ps -ef | grep consumer_name

and kill that process:

kill -9 process_id
Valentino answered 19/7, 2018 at 21:38 Comment(2)
After enter the commad:- bin/kafka-server-start.sh config/server.properties kafka server is not startKiddy
Not showing any error after enter doesnt showing any processKiddy
T
6

Or simply:

sudo systemctl restart kafka
Textile answered 2/11, 2020 at 14:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.