• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Install Apache Kafka on Ubuntu 16.04 : Single Cloud Server

By Abhishek Ghosh June 11, 2017 3:25 am Updated on June 11, 2017

Install Apache Kafka on Ubuntu 16.04 : Single Cloud Server

Advertisement

Apache Kafka is a stream processing platform which aims to provide a low-latency platform for handling real-time data feeds. Its storage is a massively scalable pub/sub message queue architected as a distributed transaction log making it valuable to process streaming data. Kafka can connect to external systems for data import/export. Apache Kafka is a part of Big Data analysis too. Here are the steps on how to install Apache Kafka on Ubuntu 16.04 running one single cloud server instance. We have a list of tutorials on Big Data cloud tools. But Kafka is preferred among many of the tools for various reasons. The way of installation of Apache Kafka is more closer to installation of other Apache Big Data tools.

Install Apache Kafka on Ubuntu 16-04 - Single Cloud Server

 

Install Apache Kafka on Ubuntu 16.04

 

Apache Kafka needs a Java runtime environment and a user with sudo privilege. In the example, we will use the user name kafka. The command adduser will automatically create the user, initial group, and home directory. Run these commands one by one :

Vim
1
2
3
adduser kafka
id kafka
ls -lad /home/kafka/

Now we will set the user for sudo permission to allow to be in suoders list :

Advertisement

---

Vim
1
echo 'kafka ALL=(ALL) ALL' >> /etc/sudoers

Type exit to exit the session and run command SSH with that username :

Vim
1
ssh kafka@your-IP-addresss

After login, type :

Vim
1
sudo su

Now you’ll become root user. Now, you may be in need in future to close the way for kafka to SSH. Open this file :

Vim
1
nano /etc/ssh/sshd_config

You’ll add entry of kafka to SSH if needed by having syntax like this :

Vim
1
DenyUsers kafka

save the file. Run these commands :

Vim
1
2
/etc/init.d/sshd restart
sudo service ssh restart

During initial installation do not do the changes in /etc/ssh/sshd_config. You’ll install the software by SSH to the system as any permitted user and run su kafka to become kafka.

Next we will install Java. There are two ways, one is using oracle-java8 :

Vim
1
2
3
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt update
apt install oracle-java8-installer -y

Another is the default Java Run Time provided by apt :

Vim
1
apt install default-jre

Follow the way you want. Verify that JDK 8 is installed properly

Vim
1
java -version

Kafka cluster depends on ZooKeeper to perform operations such as detecting failed nodes. Kafka brokers need it to form a cluster, and the configuration is stored in ZK nodes. Newer versions of Kafka have decoupled the clients to consumers and producers. We still need ZooKeeper to run Kafka brokers. Once we install Kafka, we can use the ZooKeeper available with Kafka. But we will use ZooKeeper package that is available in Ubuntu’s repository.

Vim
1
sudo apt install zookeeperd

ZooKeeper will be started as a daemon automatically. By default, it will listen on port 2181 :

Vim
1
sudo netstat -nlpt | grep ':2181'

Now go to :

Vim
1
cd /opt

We will install the current stable version from :

Vim
1
http://kafka.apache.org/downloads.html

Version 0.10.2.1 is latest at the time of publication. We are showing example with one mirror, browse here on browser:

Vim
1
http://www-eu.apache.org/dist/kafka/

and click 0.10.2.1 link, these are the files :

Vim
1
2
3
4
5
6
7
8
9
10
javadoc/                          2017-04-27 01:29    -  
RELEASE_NOTES.html                2017-04-27 01:29  5.4K  
kafka-0.10.2.1-src.tgz            2017-04-27 01:29  3.8M  
kafka_2.10-0.10.2.1-site-docs.tgz 2017-04-27 01:29  1.9M  
kafka_2.10-0.10.2.1.tgz           2017-04-27 01:29   37M  
kafka_2.11-0.10.2.1-site-docs.tgz 2017-04-27 01:29  1.9M  
kafka_2.11-0.10.2.1.tgz           2017-04-27 01:29   36M  
kafka_2.12-0.10.2.1-site-docs.tgz 2017-04-27 01:29  1.9M  
kafka_2.12-0.10.2.1.tgz           2017-04-27 01:29   32M  
...

You know that version 0.10.2.1 is latest. So here /0.10.2.1/kafka-0.10.2.1-src.tgz will be your file.

Vim
1
2
3
4
5
6
7
# check /usr/local/kafka
ls /usr/local/kafka
cd /opt
curl -O http://www-eu.apache.org/dist/kafka/0.10.2.1/kafka-0.10.2.1-src.tgz
tar -xvf kafka_2.11-0.10.1.1.tgz -C /usr/local/kafka
ls /usr/local/kafka
rm kafka-0.10.2.1-src.tgz

Open this file and look for delete.topic.enable :

Vim
1
nano /usr/local/kafka/config/server.properites

Make it like this :

Vim
1
delete.topic.enable = true

Save the file. Start Kafka by running kafka-server-start.sh script :

Vim
1
sudo /opt/kafka/kafka_2.11-0.10.1.1/bin/kafka-server-start.sh /opt/kafka/kafka_2.11-0.10.1.1/config/server.properties

Now, we can check listening ports of ZooKeeper and Kafka :

Vim
1
netstat -ant | grep -E ':2181|:9092'

Expected output :

Vim
1
2
tcp6       0      0 :::9092                 :::*                    LISTEN      1367/java      
tcp6       0      0 :::2181                 :::*                    LISTEN      -        

To stop, you’ll need to run script kafka-server-stop.sh in the same way like we started above. Of course you can create topic :

Vim
1
/usr/local/kafka/bin/kafka-topics.sh --create --topic topic-test --zookeeper localhost:2181 --partitions 1 --replication-factor 1

 

Install Apache Kafka on Ubuntu 16.04 : Configure With Spark

 

I am showing additional steps :

Vim
1
2
3
4
5
6
7
8
wget https://dl.bintray.com/sbt/debian/sbt-0.13.11.deb
sudo dpkg -i sbt-0.13.11.deb
sudo apt update
sudo apt install sbt
wget http://d3kbcqa49mib13.cloudfront.net/spark-2.0.0-bin-hadoop2.7.tgz
tar xvf spark-2.0.0-bin-hadoop2.7.tgz
sudo mv spark-2.0.0-bin-hadoop2.7 /usr/local/spark
nano ~/.profile

Add spark configuration to profile :

Vim
1
2
3
  # set PATH so it includes user's private bin directories
  PATH="/usr/local/spark/bin:$HOME/bin:$HOME/.local/bin:$PATH"
  export PYSPARK_PYTHON=python3

Source it :

Vim
1
source ~/.profile

Test configuration :

Vim
1
pyspark

Rest you should read from :

Vim
1
https://spark.apache.org/docs/latest/streaming-kafka-integration.html

Tagged With how to install kafka in ubuntu 16 04 , ubuntu 16 04 kafka , paperuri:(108c3623ac2d984417555b006f9ad595) , kafka install ubuntu 16 04 , kafka install on ubuntu , install kafka ubuntu , install and run kafka on ubunto , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1840 oUY7-wRvL8K9vboTzbm1iDu4W4RZhd0TqRzbVLakJNdcf1vAWvv2PLwA6PxFsT6R d03d4c30fb477809eaa1de289700e1e77083e8f7&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1839 HXgl4J4B-fIQCo3FLUJmWgls60rs7bdRc-kpVduTEOlOizsg24NkbacRIVTTsr1M acdb8411b57dff8c1e488955156d5497be85d8be&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , how to install kafka on ubuntu 16
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Install Apache Kafka on Ubuntu 16.04 : Single Cloud Server

  • Install Apache Spark on Ubuntu Single Cloud Server With Hadoop

    Here is How to Install Apache Spark on Ubuntu Single Cloud Server With Hadoop and Also Without Hadoop. Everything is Explained in Plain English.

  • Installing Local Data Lake on Ubuntu Server : Part 1

    Here is Part 1 of Installing Local Data Lake on Ubuntu Server With Hadoop, Spark, Thriftserver, Jupyter etc To Build a Prediction System.

  • Apache Free Software Solutions for Data Streaming

    Real-time data analysis is an important part of businesses. Here is a Discussion on Apache Free Software Solutions for Data Streaming.

  • Install Apache Hadoop on Ubuntu on Single Cloud Server Instance

    Here is How Install Apache Hadoop on Ubuntu on Single Cloud Server Instance in Stand-Alone Mode With Minimum System Requirement and Commands.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy