• 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

This Article Has Been Shared 990 Times!

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

  • 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.

  • Big Data as a Service (BDaaS) Basics

    Big Data as a Service or BDaaS, is as if combination of SaaS, PaaS and DaaS. Self Hosting Big Data platform is time consuming and costly.

  • What is Data Lake in Big Data?

    A data lake comprises of multiple repositories providing data to an organisation for analytical processing including analytics & reporting.

  • Integration of Apache Hadoop With OpenStack Swift

    The Topic Integration of Apache Hadoop With OpenStack Swift Is Not Exactly New. You Can Follow Our Guide Specially For Handling OpenStack.

  • Building Big Data Analytics Solutions In The Cloud With Tools From IBM

    We Can Plan Building Big Data Analytics Solutions In The Cloud With Tools From IBM For Cost Reduction, Simplicity & Using Advanced Features.

Additionally, 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

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Install Apache Kafka on Ubuntu 16.04 : Single Cloud Server," in The Customize Windows, June 11, 2017, February 1, 2023, https://thecustomizewindows.com/2017/06/install-apache-kafka-ubuntu-16-04-cloud-server/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT