Learn how to list all kafka topics using the command line. In this quick tutorial, we're going to see how we can list all topics in an Apache Kafka cluster. First, we'll set up a single-node Apache Kafka and Zookeeper cluster. Then, we'll ask that cluster about its topics.
In this quick tutorial, we're going to see how we can list all topics in an Apache Kafka cluster.
First, we'll set up a single-node Apache Kafka and Zookeeper cluster. Then, we'll ask that cluster about its topics.
Before listing all the topics in a Kafka cluster, let's set up a test single-node Kafka cluster in three steps:
First, we should make sure to download the right Kafka version from the Apache site. Once the download finishes, we should extract the downloaded archive:
$ tar xvf kafka_2.13-2.6.0.tgz
Kafka is using Apache Zookeeper to manage its cluster metadata, so we need a running Zookeeper cluster.
For test purposes, we can run a single-node Zookeeper instance using the zookeeper-server-start.sh script in the bin directory:
$ cd kafka_2.13-2.6.0 ## extracted directory$ ./bin/zookeeper-server-start.sh config/zookeeper.properties
This will start a Zookeeper service listening on port 2181. After this, we can use another script to run the Kafka server:
$ ./bin/kafka-server-start.sh config/server.properties
After a while, a Kafka broker will start. Let's add a few topics to this simple cluster:
$ bin/kafka-topics.sh --create --topic users.registrations --replication-factor 1 \ --partitions 2 --zookeeper localhost:2181$ bin/kafka-topics.sh --create --topic users.verfications --replication-factor 1 \ --partitions 2 --zookeeper localhost:2181
Now that everything is ready, let's see how we can list Kafka topics.
Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.
To move or not to move? Benefits are multifold when you are migrating to the cloud. Get the correct information to make your decision, with our cloud engineering expertise.
Cloud computing is a one-stop solution to what can be the biggest problems for businesses in the future, i.e., storage of data. Therefore, whether your company belongs to the private or public sector, you should consider including cloud computing...
Develop highly scalable apps on Amazon Cloud Services in India. Mobile App Development India Offers Amazon cloud web services (AWS) for app development, database storage solution, hosting solution etc.
Learn about the positive impact of cloud computing on mobile app development, and how it will help reduce your app development cost.