How to Install Apache Kafka on Debian 11 (Linux Message Broker). In this article we will introduce what Apache Kafka is with it’s features and next we will move onto installation phase on Debian 11.
What is Apache Kafka
Apache Kafka is a distributed event streaming platform that receives data from distinct sources and shares it with the target system in real time. Written in Scala and Java, the open source distributed publish subscribe messaging system facilitates the asynchronous data exchange between servers and applications.
Today, the adaptation of Kafka has enabled businesses to deliver timely experiences to consumers and manage real time data.
Earlier, the data processing followed the batch processing technique. As per the periodic batch processing technique, all the raw data was collected and stored first. Later it was processed at arbitrary time intervals. For example, companies used to wait till the month end or week to analyze all the collected information, calculate profits and expenses. The only drawback of practicing batch processing was it did not provide real time data.
With the growth and expansion of businesses, the need for analyzing data in real time has become necessary to make better decisions and strategies. With Apache Kafka server this requirement to stream events in real time was resolved. Another feature that makes Kafka different from other messaging systems is it stores all messages for a period and consumers are solely responsible for tracking read messages.
If you want to build resilient data services and applications, look no further. Kafka is a fast, highly scalable and fault tolerant publish subscribe system. It has five core functions, including Publish, Consume, Process, Connect, Store. These functions enable the system to deliver higher throughput. Further, it relies on the file system for maintaining and caching purposes.
Today, thousands of companies trust the platform as it stores all the streams safely in a fault tolerant cluster and delivers messages at a network limited throughput. Also, it has an out of the box Connect interface that allows integration with various event sources such as Elasticsearch, AWS S3, Postgres, etc.
Next in this tutorial about How to Install Apache Kafka on Debian 11 (Linux Message Broker) is to explain Apache Kafka benefits. Let’s do it!
There are various reasons why many high profile companies are investing in Apache Kafka for collecting data in real time. Have a look at some of its benefits that might convince you and help change your mind.
Open Source
Kafka is an Open Source platform, i.e., the source code is free and available to all developers or users for modification. There are no restrictions or licensing fees for the same.
Scale and Speed
Unlike other messaging systems, Kafka provides the data in real time. Also, being a distributed platform, all the processing work is distributed among different physical and virtual machines. It further helps in scaling out and providing quick results.
Extensible
Kafka collaborates with Zookeeper to coordinate and synchronize with other services
Performance
Kafka provides a queue that can handle large amounts of data and move messages from one sender to another.
Fault tolerant
Kafka is a publish subscribe messaging system built for high throughput and fault tolerance.Kafka supports automatic recovery features and is resilient to node failures. It ensures that even if one node goes down the other will replaces it and deliver a quality result.
Replication
Copies of various topics are automatically generated, but with Kafka, customers have the ability to manually configure topics and prevent replication as per their needs.
Allows message replay
Kafka has certain features that enable multiple consumers to subscribe to a similar topic and replay the messages for a specific period of time.
Stream Processing
Apache Kafka allows seamless movement of data in the form of messages, streams, or records. Further, it allows users to inspect, transform and leverage data before moving. The platform is easy to use and supports a native approach for storing and moving data in real time.
Seamless Messaging Functionality
Organizations that use legacy communications models to deal with large volume data often find issues in communications and scalability. However, with the messaging and streaming functionality, Kafka has reduced this issue and users can publish, subscribe, store and process data in real time.
Next we will explain how to install Apache Kafka on Debian 11.
Apache Kafka is a Java based application. So Java must be installed on your system. If not installed, you can install it by running the following command:
apt-get install default-jdk -y
Once Java is installed, verify the Java installation using the following command:
java --version
You will get the following output:
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing)
Save and close the file then navigate to the CMAK directory and create a zip file for deploying the application:
cd ~/CMAK
./sbt clean dist
You will get the following output:
[info] Main Scala API documentation to /root/CMAK/target/scala-2.12/api...
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.10. Compiling...
[info] Compiling 136 Scala sources and 2 Java sources to /root/CMAK/target/scala-2.12/classes ...
[info] Compilation completed in 17.571s.
model contains 645 documentable templates
[info] Main Scala API documentation successful.
[info] LESS compiling on 1 source(s)
[success] All package validations passed
[info] Your package is ready in /root/CMAK/target/universal/cmak-3.0.0.6.zip
[success] Total time: 192 s (03:12), completed Mar 25, 2022, 5:51:09 AM
Graal diagnostic output saved in /root/CMAK/dumps/1648187271178/graal_diagnostics_10375.zip
Next, naviage to the ~/CMAK/target/universal directory and unzip the zip file:
cd ~/CMAK/target/universal
unzip cmak-3.0.0.6.zip
Please change the directory to the extracted directory and run the cmak binary:
cd cmak-3.0.0.6
bin/cmak
If everything is fine, you will get the following output:
How to Install Apache Kafka on Debian 11 (Linux Message Broker) Conclusion
In the above guide, we explained how to install Apache Kafka on Debian 11. We also explained how to install the Kafka Cluster Manager to manage Apache Kafka. I hope you can now deploy the Apache Kafka in the production environment.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.
00votes
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.