Not able to start Kafka service

0 votes

I am trying to start Kafka server using:

$ ​sudo systemctl start kafka

but I am getting the following error:

Failed to start kafka.service: Unit kafka.service not found.

Feb 21, 2019 in Apache Kafka by Sowmya
4,474 views

2 answers to this question.

0 votes

You might not have created the systemd service for kafka. To do this, open the kafka.service file:

$ sudo nano /etc/systemd/system/kafka.service

And add the following entries:

[Unit]

Requires=zookeeper.service

After=zookeeper.service


[Service]

Type=simple

User=kafka

ExecStart=/bin/sh -c '/home/kafka/kafka/bin/kafka-server-start.sh /home/kafka/kafka/config/server.properties > /home/kafka/kafka/kafka.log 2>&1'

ExecStop=/home/kafka/kafka/bin/kafka-server-stop.sh

Restart=on-abnormal


[Install]

WantedBy=multi-user.target

And then run:

$ ​sudo systemctl start kafka

answered Feb 21, 2019 by Suman
0 votes
If your service, in this case kafka, doesn't have a .service at the end of its name the system will not recognize the file as a service file. Simple fix if you have the service created. "sudo cd /etc/systemd/system" then "mv <servicename> <servicename>.service". Should be able to launch from there.
answered May 9, 2019 by Novice

Related Questions In Apache Kafka

+1 vote
1 answer

Kafka consumer not able to start reading messages from the last uncommitted offsets

Hi@prasant, I am not sure it will work ...READ MORE

answered Feb 18 in Apache Kafka by MD
• 34,760 points
1,441 views
0 votes
2 answers

Kafka service not starting. Shows no output

sudo systemctl status kafka This should at least ...READ MORE

answered May 9, 2019 in Apache Kafka by Novice
1,849 views
0 votes
1 answer

Is there any change in consumer offsets if a new partition(s) is added to a Kafka topic?

Yes, it stays the same. An offset is ...READ MORE

answered Jul 9, 2018 in Apache Kafka by nitinrawat895
• 10,920 points
625 views
0 votes
1 answer

Kafka topic not being deleted

By default in Kafka version 0.10, delete.topic.enable ...READ MORE

answered Jul 9, 2018 in Apache Kafka by nitinrawat895
• 10,920 points
1,099 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
5,338 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
784 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
32,613 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,310 points
2,008 views
0 votes
1 answer

Not able to fetch messages from Kafka cluster

You need to add the hostname in ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 13,380 points
1,046 views
0 votes
1 answer

Not able to download Kafka using curl

The output to download this is in ...READ MORE

answered Feb 21, 2019 in Apache Kafka by Omkar
• 69,040 points
779 views