Installing Kafka on Ubuntu

0 votes
Hello. Is there an easy way to install Kafka in Ubuntu?
Feb 21, 2019 in Apache Kafka by Girish
2,227 views

1 answer to this question.

0 votes

I am not sure what you expect by easy way. But here are the steps to install Kafka:

You can install Kafka with the help of Zookeeper(installation link here).

First, we need to get the kafka files. You can download it from the following website:

https://kafka.apache.org/downloads

Extract the file using:

$ tar -xvf kafka-2.1.1-src.tgz

Next, you have to configure kafka server

In the kafka directory, search for server.properties and open it with a text editor:

$ cd /kafka-2.1.1-src/config/

$ nano server.properties

Add the following line at the end of the file:

delete.topic.enable = true

This will allow us to delete kafka topic (it is disabled by default)

Next, open the zookeeper.service file:

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

And add the below entries:

[Unit]

Requires=network.target remote-fs.target

After=network.target remote-fs.target


[Service]

Type=simple

User=kafka

ExecStart=/home/kafka/kafka/bin/zookeeper-server-start.sh /home/kafka/kafka/config/zookeeper.properties

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

Restart=on-abnormal


[Install]

WantedBy=multi-user.target

And finally, create systemd service:

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

Lastly, to start kafka service, run:

$ sudo systemctl start kafka


Hope this helps!

To know more about Kafka, I would recommend you to enroll with Kafka training online today.

Thanks.

answered Feb 21, 2019 by Arun

Related Questions In Apache Kafka

0 votes
1 answer
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
• 11,380 points
2,391 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
• 11,380 points
3,054 views
0 votes
1 answer

Re-balancing error while reading messages from Kafka.

rebalance.backoff.ms defines the time for which Kafka ...READ MORE

answered Jul 10, 2018 in Apache Kafka by Shubham
• 13,490 points
2,899 views
+2 votes
9 answers

Writing the Kafka consumer output to a file

System.out.println(String.valueOf(output.offset()) + ": " + new String(bytes, ...READ MORE

answered Dec 7, 2018 in Apache Kafka by Harsh
38,539 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
• 11,380 points
11,016 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
• 11,380 points
2,528 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,740 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,350 points
4,605 views
+3 votes
1 answer

How to install Kafka on Windows System?

These are the steps to install Kafka ...READ MORE

answered Feb 25, 2019 in Apache Kafka by Ramya
14,083 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP