SlideShare a Scribd company logo
********************************************************************************
*****************************************************
Single Broker Cluster
********************************************************************************
*****************************************************
Start Zookeeper [seperate terminal]
---------------
bin/zookeeper-server-start.sh config/zookeeper.properties
Start Kafka broker [seperate terminal]
------------------
bin/kafka-server-start.sh config/server.properties
________________________________________________________________________________
_____________________________________________________
Create Topic
------------
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1
--partitions 1 --topic testtopic
List Topic
----------
bin/kafka-topics.sh --list --zookeeper localhost:2181
Display Topic Information
-------------------------
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic testtopic
Add Partitions to a Topic
-------------------------
bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic testopic
--partitions 2
________________________________________________________________________________
_____________________________________________________
Start Producer [seperate terminal]
--------------
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testtopic
Start Consumer [seperate terminal]
--------------
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-
beginning
________________________________________________________________________________
_____________________________________________________
Note: To understand the flow refer Kafka Tutorial.mp4
********************************************************************************
*****************************************************
Multi Broker Cluster
********************************************************************************
*****************************************************
Create config file for 2 more Kafka Brokers
-------------------------------------------
cp config/server.properties config/server-1.properties
cp config/server.properties config/server-2.properties
Edit config file 2 Kafka Brokers created above
----------------------------------------------
config/server-1.properties:
broker.id=1
port=9093
log.dir=/tmp/kafka-logs-1
config/server-2.properties:
broker.id=2
port=9094
log.dir=/tmp/kafka-logs-2
Start 2 newly created Kafka Brokers [seperate terminal]
-----------------------------------
JMX_PORT=9997 bin/kafka-server-start.sh config/server-1.properties &
JMX_PORT=9998 bin/kafka-server-start.sh config/server-2.properties &
Create Topic
------------
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3
--partitions 1 --topic my-replicated-topic
List Topic
----------
bin/kafka-topics.sh --list --zookeeper localhost:2181
Start Producer [seperate terminal]
--------------
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my-
replicated-topic
Start Consumer [seperate terminal]
--------------
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning
--topic my-replicated-topic
Kill one of the Kafka Brokers
-----------------------------
pkill -9 -f server-1.properties
List Topic
----------
bin/kafka-topics.sh --list --zookeeper localhost:2181
Start Consumer [seperate terminal]
--------------
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning
--topic my-replicated-topic

More Related Content

Similar to Quick reference for kafka (20)

PPTX
Message queue demo
DataArt
 
PDF
Kafka Workshop
Alexandre André
 
PDF
Introduction to Apache Kafka
Shiao-An Yuan
 
DOCX
Apache kafka configuration-guide
Chetan Khatri
 
PDF
Setup 3 Node Kafka Cluster on AWS - Hands On
hkbhadraa
 
DOCX
KAFKA Quickstart
Vikram Singh Chandel
 
ODP
Kafka aws
Ariel Moskovich
 
PDF
Apache Kafka Architecture & Fundamentals Explained
confluent
 
PDF
Tutorial Kafka-Storm
Universidad de Santiago de Chile
 
PDF
Apache KAfka
Pedro Alcantara
 
PDF
Kafka zero to hero
Avi Levi
 
PDF
Apache Kafka - From zero to hero
Apache Kafka TLV
 
PDF
Kafka and kafka connect
Touraj Ebrahimi
 
PDF
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
PPTX
Training
HemantDunga1
 
PDF
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
ODP
Apache Kafka Demo
Edward Capriolo
 
PPTX
kafka-steaming-data
Bryan Jacobs
 
DOCX
Kafk a with zoo keeper setup documentation
Thiyagarajan saminadane
 
PPTX
Kafka blr-meetup-presentation - Kafka internals
Ayyappadas Ravindran (Appu)
 
Message queue demo
DataArt
 
Kafka Workshop
Alexandre André
 
Introduction to Apache Kafka
Shiao-An Yuan
 
Apache kafka configuration-guide
Chetan Khatri
 
Setup 3 Node Kafka Cluster on AWS - Hands On
hkbhadraa
 
KAFKA Quickstart
Vikram Singh Chandel
 
Kafka aws
Ariel Moskovich
 
Apache Kafka Architecture & Fundamentals Explained
confluent
 
Tutorial Kafka-Storm
Universidad de Santiago de Chile
 
Apache KAfka
Pedro Alcantara
 
Kafka zero to hero
Avi Levi
 
Apache Kafka - From zero to hero
Apache Kafka TLV
 
Kafka and kafka connect
Touraj Ebrahimi
 
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
Training
HemantDunga1
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
Apache Kafka Demo
Edward Capriolo
 
kafka-steaming-data
Bryan Jacobs
 
Kafk a with zoo keeper setup documentation
Thiyagarajan saminadane
 
Kafka blr-meetup-presentation - Kafka internals
Ayyappadas Ravindran (Appu)
 

More from Rajkumar Asohan, PMP (8)

PDF
Quick reference for Grafana
Rajkumar Asohan, PMP
 
TXT
Quick reference for solr
Rajkumar Asohan, PMP
 
TXT
Quick reference for spark sql
Rajkumar Asohan, PMP
 
TXT
Quick reference for mongo shell commands
Rajkumar Asohan, PMP
 
TXT
Quick reference for zookeeper commands
Rajkumar Asohan, PMP
 
TXT
Quick reference for HBase shell commands
Rajkumar Asohan, PMP
 
TXT
Quick reference for curl
Rajkumar Asohan, PMP
 
TXT
Quick reference for cql
Rajkumar Asohan, PMP
 
Quick reference for Grafana
Rajkumar Asohan, PMP
 
Quick reference for solr
Rajkumar Asohan, PMP
 
Quick reference for spark sql
Rajkumar Asohan, PMP
 
Quick reference for mongo shell commands
Rajkumar Asohan, PMP
 
Quick reference for zookeeper commands
Rajkumar Asohan, PMP
 
Quick reference for HBase shell commands
Rajkumar Asohan, PMP
 
Quick reference for curl
Rajkumar Asohan, PMP
 
Quick reference for cql
Rajkumar Asohan, PMP
 
Ad

Recently uploaded (20)

PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PDF
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
PPTX
PPT on the Development of Education in the Victorian England
Beena E S
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
PPT on the Development of Education in the Victorian England
Beena E S
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
Ad

Quick reference for kafka

  • 1. ******************************************************************************** ***************************************************** Single Broker Cluster ******************************************************************************** ***************************************************** Start Zookeeper [seperate terminal] --------------- bin/zookeeper-server-start.sh config/zookeeper.properties Start Kafka broker [seperate terminal] ------------------ bin/kafka-server-start.sh config/server.properties ________________________________________________________________________________ _____________________________________________________ Create Topic ------------ bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testtopic List Topic ---------- bin/kafka-topics.sh --list --zookeeper localhost:2181 Display Topic Information ------------------------- bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic testtopic Add Partitions to a Topic ------------------------- bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic testopic --partitions 2 ________________________________________________________________________________ _____________________________________________________ Start Producer [seperate terminal] -------------- bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testtopic Start Consumer [seperate terminal] -------------- bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from- beginning ________________________________________________________________________________ _____________________________________________________ Note: To understand the flow refer Kafka Tutorial.mp4 ******************************************************************************** ***************************************************** Multi Broker Cluster ******************************************************************************** ***************************************************** Create config file for 2 more Kafka Brokers ------------------------------------------- cp config/server.properties config/server-1.properties cp config/server.properties config/server-2.properties Edit config file 2 Kafka Brokers created above ---------------------------------------------- config/server-1.properties: broker.id=1 port=9093
  • 2. log.dir=/tmp/kafka-logs-1 config/server-2.properties: broker.id=2 port=9094 log.dir=/tmp/kafka-logs-2 Start 2 newly created Kafka Brokers [seperate terminal] ----------------------------------- JMX_PORT=9997 bin/kafka-server-start.sh config/server-1.properties & JMX_PORT=9998 bin/kafka-server-start.sh config/server-2.properties & Create Topic ------------ bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-replicated-topic List Topic ---------- bin/kafka-topics.sh --list --zookeeper localhost:2181 Start Producer [seperate terminal] -------------- bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my- replicated-topic Start Consumer [seperate terminal] -------------- bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic Kill one of the Kafka Brokers ----------------------------- pkill -9 -f server-1.properties List Topic ---------- bin/kafka-topics.sh --list --zookeeper localhost:2181 Start Consumer [seperate terminal] -------------- bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic my-replicated-topic