Kafka is a distributed streaming platform that is used to build real-time streaming data pipelines and can be run on various operating systems. In this tutorial, we are going to learn how to install Kafka on Kali Linux Latest.
After downloading Kafka, navigate to the directory where it was downloaded and extract the archive by running:
tar -xzf kafka_<version>.tgz
Note: Replace <version>
with the version number of the Kafka release you downloaded.
cd kafka_<version>
Kafka uses ZooKeeper to manage and maintain configuration data. Start ZooKeeper by running the following command:
bin/zookeeper-server-start.sh config/zookeeper.properties
This will start ZooKeeper.
In a new terminal tab/window, navigate to the kafka_<version>
directory and start the Kafka server by running the following command:
bin/kafka-server-start.sh config/server.properties
Kafka uses topics to manage streams of records. To create a topic, run the following command:
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
This will create a topic named test
.
To produce messages to the topic, run the following command:
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test
This will start the producer console.
To consume messages from the topic, run the following command in a new terminal tab/window:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
This will start the consumer console and display all the messages produced to the test
topic.
Congratulations! You have successfully installed Kafka on Kali Linux Latest and produced and consumed data using Kafka.
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!