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
Safe Broker Restarts Once you are ready to start the broker back up, you can do so with a simple service kafka start. It will likely take a few minutes for the broker to recover after restarting. It needs to check all of its recent logs to make sure that it doesn't have any incomplete messages.
Go to the Kafka home directory and execute the command ./bin/kafka-server-start.sh config/server. properties . Stop the Kafka broker through the command ./bin/kafka-server-stop.sh .
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
Or simply:
sudo systemctl restart kafka
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With