Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with kafka - Failed with result 'exit-code', status=1/FAILURE

Tags:

apache-kafka

I tried to install apache-kafka several times but I always had this problem. I'm using ubuntu on my virtual machine. When I'm trying to activate kafka service using sudo systemctl start kafka and then controlling if it's working at first, the output is "active (running)", but if I double-check it and the output is "failed (Result: exit-code) ". And I tried sudo systemctl enable kafka but it didn't work.

This is the output:

● kafka.service

 Loaded: loaded (/etc/systemd/system/kafka.service; enabled; vendor preset: enabled)
 Active: failed (Result: exit-code) since Wed 2021-05-26 05:40:22 PDT; 3s ago
 Process: 8098 ExecStart=/bin/sh -c /home/kafka/kafka/bin/kafka-server-start.sh /home/kafka/kafka/co>
 Main PID: 8098 (code=exited, status=1/FAILURE)

 May 26 05:40:19 ubuntu systemd[1]: Started kafka.service.
 May 26 05:40:22 ubuntu systemd[1]: kafka.service: Main process exited, code=exited, status=1/FAILURE
 May 26 05:40:22 ubuntu systemd[1]: kafka.service: Failed with result 'exit-code'. 

You can see the full output attached

enter image description here

I also tried journalctl -xe and it recommended using ./gradlew jar -PscalaVersion=2.13.5, and I download it, at first it seemed to work, but the following day I had the same problem ( kafka.service: Failed with result 'exit-code'.). And if I tried journalctl -xe I had an output that you can see attached.

enter image description here

With zookeeper I had no problem, it's always active.

Thank you in advance.

like image 768
nataliya Avatar asked Mar 06 '26 00:03

nataliya


1 Answers

Open the file meta.properties.

In my case, it was located at the path /home/kafka/logs/meta.properties

Just comment the the cluster.id with a #

Restart zookeeper and kafka.

like image 129
Kartik_Bhatnagar Avatar answered Mar 08 '26 20:03

Kartik_Bhatnagar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!