How to Install Kafka on Clear Linux Latest

In this tutorial, we will guide you through the steps to install Kafka on Clear Linux Latest.

Prerequisites

Before proceeding with the installation, you will need the following:

Step 1 - Install Java

Kafka requires Java to be installed on the system. The Clear Linux Latest comes with OpenJDK pre-installed but we recommend installing Oracle JDK for better performance.

To install Oracle JDK 11, follow the below commands.

sudo swupd bundle-add java-runtime
sudo swupd bundle-add java-basic

Check the Java version by running the java -version command. If installed correctly, you should see the following output:

java version "11.0.5" 2019-10-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode)

Step 2 - Download Kafka

  1. Open the Kafka Download Page on your web browser.
  2. On the page, choose the latest stable version of Kafka and click on the download link for the binary program of your choice (for example, kafka_2.13-2.6.2.tgz).
  3. Navigate to the directory where you want to download and extract the Kafka archive, and execute the following command to download the Kafka package:
wget https://mirror.csclub.uwaterloo.ca/apache/kafka/2.6.2/kafka_2.13-2.6.2.tgz
  1. Extract the downloaded archive using the following command:
tar -xzf kafka_2.13-2.6.2.tgz
  1. Move the extracted Kafka directory to the desired location:
mv kafka_2.13-2.6.2 /opt/kafka

Step 3 - Start Kafka Cluster

  1. Change to the Kafka directory:
cd /opt/kafka
  1. Start the Kafka server and ZooKeeper by creating two separate processes with the following command:
./bin/zookeeper-server-start.sh config/zookeeper.properties &
./bin/kafka-server-start.sh config/server.properties &

Step 4 - Create Kafka Topics

  1. To create a Kafka topic, use the following command:
./bin/kafka-topics.sh --create --topic my-topic --bootstrap-server localhost:9092
  1. To check the list of available topics, execute the following command:
./bin/kafka-topics.sh --list --bootstrap-server localhost:9092

Conclusion

That’s it! You have successfully installed Apache Kafka on Clear Linux Latest. You can now use Kafka on your machine to build robust and scalable real-time streaming applications.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!