0% found this document useful (0 votes)
28 views1 page

Kafka Commands

The document provides instructions for starting Zookeeper and Kafka brokers, creating and managing topics, and using consumers and producers in Kafka. It also outlines steps for integrating Flume with Kafka, including creating a topic and running Flume agents to read and write data. The commands are specified for various operations such as creating, listing, describing, and deleting topics, as well as producing and consuming messages.

Uploaded by

santymusic59
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

Kafka Commands

The document provides instructions for starting Zookeeper and Kafka brokers, creating and managing topics, and using consumers and producers in Kafka. It also outlines steps for integrating Flume with Kafka, including creating a topic and running Flume agents to read and write data. The commands are specified for various operations such as creating, listing, describing, and deleting topics, as well as producing and consuming messages.

Uploaded by

santymusic59
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Start Zookeeper => zookeeper-server-start.

sh
$KAFKA_HOME/config/zookeeper.properties
Start Broker => kafka-server-start.sh $KAFKA_HOME/config/server.properties

Topics =>
kafka-topics.sh --create --zookeeper localhost:5181 --partitions 1 --replication-
factor 1 --topic mytopic
kafka-topics.sh --zookeeper localhost:5181 -list
kafka-topics.sh --describe --topic mytopic --zookeeper localhost:5181
kafka-topics.sh --delete --zookeeper localhost:5181 --topic mytopic

Consumer =>
kafka-console-consumer.sh --zookeeper localhost:5181 --topic mytopic2 --from-
beginning
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mytopic --from-
beginning

Producer =>
kafka-console-producer.sh --broker-list localhost:9092 --topic mytopic

FLAFKA =>
1. Create a topic in KAFKA
kafka-topics.sh --create --zookeeper localhost:5181 --partitions 1 --
replication-factor 1 --topic flafkatopic

2. Run Flume agent to read data from netcat which will be a producer to Kafka
topics
flume-ng agent --name FlafkaAgent --conf $FLUME_HOME/conf/ --conf-file
code/flumeprop/flafka_producer -Dflume.root.logger=INFO,console
3. Run another Flume agent to read data from Kafka topics
flume-ng agent --name flume1 --conf $FLUME_HOME/conf/ --conf-file
code/flumeprop/flafka_consumer -Dflume.root.logger=INFO,console

You might also like