際際滷

際際滷Share a Scribd company logo
Kafka & message bus
Robin GRAILLON & Alexandre ANDR
12/10/2016
Synchronous
 Call
 Processing
 Might be long
 Response
Asynchronous
 Call
 Response
 Post-Processing
Message Bus
 Events aggregation
 CQRS oriented
 袖S oriented
 Event sourcing oriented
 Language agnostic
 Multiple implementations
 RabbitMQ
 Kafka
 etc.
Apache Kafka
 LinkedIn creation
 Open sourced in 2011
 Filesystem oriented
 Wrote in Scala
 Highly scalable
 Used by big companies
 LinkedIn
 Netflix
 Spotify
 Meetic
LinkedIn statistics
 800 billion m/day
 175 TB
 13 million m/sec
 2.75 GB
 1100 kafka instances
 60 clusters
Basic workflow
Producer 1
Producer 2
Producer 3
Producer X
Consumer 1
Consumer 2
Consumer 3
Consumer Y
Kafka Stack
Kafka stack
 Zookeeper : scalability, manager
 Kafka broker : kafka server instance
 Consumer : consumes events and do things
 Producer : produces events (like user as connected)
 topic : event name
 partition : way to split messages between brokers
Kafka partitions (1)
For one topic (lets say astronaut.connection)
Kafka stack & partitions
Lets play...
...but easily !
./console run
HELP
run:zk run zookeeper
kill:zk kill zookeeper
run:kk run kafka
kill:kk kill kafka
producer run producer on topic
consumer run consumer on topic
t:c create a topic
t:d delete a topic
t:l list topics
What do you want to do?
Step 1: launch Zookeeper!
What do you want to do? run:zk
Configuration file? [./zookeeper.properties]
Port? [2181]
./../bin/zookeeper-server-start.sh ./zookeeper.properties
What do you want to do?
Step 2: launch Kafka!
What do you want to do? run:kk
Step 3: list topics!
What do you want to do? t:l
Zookeeper host? [localhost:2181]
./../bin/kafka-topics.sh --list --zookeeper localhost:2181
What do you want to do?
Step 4: create a topic!
What do you want to do? t:c
Topic name? [test]
Zookeeper host? [localhost:2181]
Partitions? [1]
Replication factor? [1]
./../bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic test
--partitions 1 --replication-factor 1
Created topic "test".
What do you want to do?
Step 5: list topics AGAIIIIN!
What do you want to do? t:l
Zookeeper host? [localhost:2181]
./../bin/kafka-topics.sh --list --zookeeper localhost:2181
test
What do you want to do?
Step 6: run a consumer!
New terminal !
$ ./console run
What do you want to do? consumer
Topic name? [test]
Zookeeper host? [localhost:2181]
From beginning? [1]
./../bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test
--from-beginning
Step 7: generate data!
What do you want to do? g
Message? [I'm an astronaut!]
How many times? [1] 10000000
File? [data_10000000.txt]
10000000/10000000 [============================] 100%
Step 8: produce events!
Back to the other terminal
What do you want to do? p
Topic name? [test]
brokers? [localhost:9092]
data_10000000.txt
Dataset to use? [data_10000000.txt]
./../bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test <
./data/data_10000000.txt
GroupId: experiment 1
 2 groupId
 2 partitions
 2 consumers
GroupId: experiment 2
 1 groupId
 2 consumer
Documentation/resources
 Kafka quick setup
https://kafka.apache.org/quickstart
 Kafka at LinkedIn
https://engineering.linkedin.com/kafka/running-kafka-scale
 Why zookeeper ?
https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka
Titre 1 Titre 2

More Related Content

What's hot (20)

Event machine
Event machineEvent machine
Event machine
almeidaricardo
Cortex: Prometheus as a Service, One Year On
Cortex: Prometheus as a Service, One Year OnCortex: Prometheus as a Service, One Year On
Cortex: Prometheus as a Service, One Year On
Kausal
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
Renzo Tom
PharoDAYS 2015: Pharo Status - by Markus Denker
PharoDAYS 2015: Pharo Status - by Markus DenkerPharoDAYS 2015: Pharo Status - by Markus Denker
PharoDAYS 2015: Pharo Status - by Markus Denker
Pharo
BSides London - Scapy Workshop
BSides London - Scapy WorkshopBSides London - Scapy Workshop
BSides London - Scapy Workshop
Adam Maxwell
GeoDistributed datacenter: the DNS way
GeoDistributed datacenter: the DNS wayGeoDistributed datacenter: the DNS way
GeoDistributed datacenter: the DNS way
Moyd.co LTD
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
Allan Denot
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
8 Ways Network Engineers use Snabb (RIPE 77)
8 Ways Network Engineers use Snabb (RIPE 77)8 Ways Network Engineers use Snabb (RIPE 77)
8 Ways Network Engineers use Snabb (RIPE 77)
Igalia
Fluentd v1 and future at techtalk
Fluentd v1 and future at techtalkFluentd v1 and future at techtalk
Fluentd v1 and future at techtalk
N Masahiro
Docker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker ContainersDocker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker Containers
Hugo Henley
AGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServerAGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServer
Ng'eno Victor
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015
fukamachi
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
Fwdays
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdx
Mathieu Elie
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Sphinx && Perl  Houston Perl Mongers - May 8th, 2014Sphinx && Perl  Houston Perl Mongers - May 8th, 2014
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Brett Estrade
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
Pharo Status Fosdem 2015
Pharo Status Fosdem 2015Pharo Status Fosdem 2015
Pharo Status Fosdem 2015
Marcus Denker
Writing Better Haskell
Writing Better HaskellWriting Better Haskell
Writing Better Haskell
nkpart
Cortex: Prometheus as a Service, One Year On
Cortex: Prometheus as a Service, One Year OnCortex: Prometheus as a Service, One Year On
Cortex: Prometheus as a Service, One Year On
Kausal
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
Renzo Tom
PharoDAYS 2015: Pharo Status - by Markus Denker
PharoDAYS 2015: Pharo Status - by Markus DenkerPharoDAYS 2015: Pharo Status - by Markus Denker
PharoDAYS 2015: Pharo Status - by Markus Denker
Pharo
BSides London - Scapy Workshop
BSides London - Scapy WorkshopBSides London - Scapy Workshop
BSides London - Scapy Workshop
Adam Maxwell
GeoDistributed datacenter: the DNS way
GeoDistributed datacenter: the DNS wayGeoDistributed datacenter: the DNS way
GeoDistributed datacenter: the DNS way
Moyd.co LTD
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
Allan Denot
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
8 Ways Network Engineers use Snabb (RIPE 77)
8 Ways Network Engineers use Snabb (RIPE 77)8 Ways Network Engineers use Snabb (RIPE 77)
8 Ways Network Engineers use Snabb (RIPE 77)
Igalia
Fluentd v1 and future at techtalk
Fluentd v1 and future at techtalkFluentd v1 and future at techtalk
Fluentd v1 and future at techtalk
N Masahiro
Docker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker ContainersDocker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker Containers
Hugo Henley
AGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServerAGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServer
Ng'eno Victor
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015
fukamachi
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
仍亠从亠亶 亠仂于 "PHP at Scale: Knowing enough to be dangerous!"
Fwdays
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdx
Mathieu Elie
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Sphinx && Perl  Houston Perl Mongers - May 8th, 2014Sphinx && Perl  Houston Perl Mongers - May 8th, 2014
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Brett Estrade
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
Pharo Status Fosdem 2015
Pharo Status Fosdem 2015Pharo Status Fosdem 2015
Pharo Status Fosdem 2015
Marcus Denker
Writing Better Haskell
Writing Better HaskellWriting Better Haskell
Writing Better Haskell
nkpart

Similar to Kafka Workshop (20)

14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
Athens Big Data
Netflix KeystoneCloud scale event processing pipeline
Netflix KeystoneCloud scale event processing pipelineNetflix KeystoneCloud scale event processing pipeline
Netflix KeystoneCloud scale event processing pipeline
Monal Daxini
Final_Report_new (1)
Final_Report_new (1)Final_Report_new (1)
Final_Report_new (1)
Adarsh Burma
Introduction to apache kafka
Introduction to apache kafkaIntroduction to apache kafka
Introduction to apache kafka
Samuel Kerrien
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Joe Stein
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
Shiao-An Yuan
Building Stream Processing as a Service
Building Stream Processing as a ServiceBuilding Stream Processing as a Service
Building Stream Processing as a Service
Steven Wu
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
Assaf Gannon
Scio - Moving to Google Cloud, A Spotify Story
 Scio - Moving to Google Cloud, A Spotify Story Scio - Moving to Google Cloud, A Spotify Story
Scio - Moving to Google Cloud, A Spotify Story
Neville Li
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Monal Daxini
[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive
Akihiro Suda
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
Damien Garros
04-Kafka.pptx
04-Kafka.pptx04-Kafka.pptx
04-Kafka.pptx
MannMehta13
04-Kafka.pptx
04-Kafka.pptx04-Kafka.pptx
04-Kafka.pptx
AdityaGanguly12
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
Natan Silnitsky
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Natan Silnitsky
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support PerspectiveApache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
HostedbyConfluent
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
DockerCon 2022 - From legacy to Kubernetes, securely & quicklyDockerCon 2022 - From legacy to Kubernetes, securely & quickly
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
Eric Smalling
Enabling Data Scientists to easily create and own Kafka Consumers
Enabling Data Scientists to easily create and own Kafka ConsumersEnabling Data Scientists to easily create and own Kafka Consumers
Enabling Data Scientists to easily create and own Kafka Consumers
Stefan Krawczyk
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
HostedbyConfluent
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
Athens Big Data
Netflix KeystoneCloud scale event processing pipeline
Netflix KeystoneCloud scale event processing pipelineNetflix KeystoneCloud scale event processing pipeline
Netflix KeystoneCloud scale event processing pipeline
Monal Daxini
Final_Report_new (1)
Final_Report_new (1)Final_Report_new (1)
Final_Report_new (1)
Adarsh Burma
Introduction to apache kafka
Introduction to apache kafkaIntroduction to apache kafka
Introduction to apache kafka
Samuel Kerrien
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Joe Stein
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
Shiao-An Yuan
Building Stream Processing as a Service
Building Stream Processing as a ServiceBuilding Stream Processing as a Service
Building Stream Processing as a Service
Steven Wu
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
Assaf Gannon
Scio - Moving to Google Cloud, A Spotify Story
 Scio - Moving to Google Cloud, A Spotify Story Scio - Moving to Google Cloud, A Spotify Story
Scio - Moving to Google Cloud, A Spotify Story
Neville Li
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Monal Daxini
[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive[KubeCon EU 2020] containerd Deep Dive
[KubeCon EU 2020] containerd Deep Dive
Akihiro Suda
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
Damien Garros
04-Kafka.pptx
04-Kafka.pptx04-Kafka.pptx
04-Kafka.pptx
MannMehta13
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
Natan Silnitsky
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Polyglot, fault-tolerant event-driven programming with kafka, kubernetes and ...
Natan Silnitsky
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support PerspectiveApache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
HostedbyConfluent
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
DockerCon 2022 - From legacy to Kubernetes, securely & quicklyDockerCon 2022 - From legacy to Kubernetes, securely & quickly
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
Eric Smalling
Enabling Data Scientists to easily create and own Kafka Consumers
Enabling Data Scientists to easily create and own Kafka ConsumersEnabling Data Scientists to easily create and own Kafka Consumers
Enabling Data Scientists to easily create and own Kafka Consumers
Stefan Krawczyk
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
Enabling Data Scientists to easily create and own Kafka Consumers | Stefan Kr...
HostedbyConfluent

Recently uploaded (20)

Floating Offshore Wind in the Celtic Sea
Floating Offshore Wind in the Celtic SeaFloating Offshore Wind in the Celtic Sea
Floating Offshore Wind in the Celtic Sea
permagoveu
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptxUnit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Kirankumar Jagtap
Urban Design and Planning Portfolio .pdf
Urban Design and Planning Portfolio .pdfUrban Design and Planning Portfolio .pdf
Urban Design and Planning Portfolio .pdf
sonam254547
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
PDF CH 1 Understansding Mechatronics.pdf
PDF CH 1 Understansding Mechatronics.pdfPDF CH 1 Understansding Mechatronics.pdf
PDF CH 1 Understansding Mechatronics.pdf
KovidAggarwal
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
VirajPasare
Protecting Secrets in Transparent Systems
Protecting Secrets in Transparent SystemsProtecting Secrets in Transparent Systems
Protecting Secrets in Transparent Systems
LucaBarbaro3
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLESAE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
Dr.PERIASAMY K
Energy Transition Factbook Bloomberg.pdf
Energy Transition Factbook Bloomberg.pdfEnergy Transition Factbook Bloomberg.pdf
Energy Transition Factbook Bloomberg.pdf
CarlosdelaFuenteMnde
Introduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptxIntroduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptx
pprakash21252
wind energy types of turbines and advantages
wind energy types of turbines and advantageswind energy types of turbines and advantages
wind energy types of turbines and advantages
MahmudHalef
International Journal of Advanced Information Technology (IJAIT)
International Journal of Advanced Information Technology (IJAIT)International Journal of Advanced Information Technology (IJAIT)
International Journal of Advanced Information Technology (IJAIT)
ijait
Topic 3.NN and DL Hopfield Networks.pptx
Topic 3.NN and DL Hopfield Networks.pptxTopic 3.NN and DL Hopfield Networks.pptx
Topic 3.NN and DL Hopfield Networks.pptx
ManjulaRavichandran5
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptxONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
balajisshetty
Artificial-Intelligence-in-Cybersecurity.pptx
Artificial-Intelligence-in-Cybersecurity.pptxArtificial-Intelligence-in-Cybersecurity.pptx
Artificial-Intelligence-in-Cybersecurity.pptx
Vigneshwarar3
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascioKtor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
infogdgmi
DEMU - Power distribution final of indian railways
DEMU - Power distribution final of indian railwaysDEMU - Power distribution final of indian railways
DEMU - Power distribution final of indian railways
mishrasanjeev119
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
QualityManager48
T32 AI Trends, Technologies, & Transformations 250323.pdf
T32 AI Trends, Technologies, & Transformations 250323.pdfT32 AI Trends, Technologies, & Transformations 250323.pdf
T32 AI Trends, Technologies, & Transformations 250323.pdf
Moustafa M Elsayed
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter SystemsUnit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
KrishnaveniKrishnara1
Floating Offshore Wind in the Celtic Sea
Floating Offshore Wind in the Celtic SeaFloating Offshore Wind in the Celtic Sea
Floating Offshore Wind in the Celtic Sea
permagoveu
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptxUnit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Kirankumar Jagtap
Urban Design and Planning Portfolio .pdf
Urban Design and Planning Portfolio .pdfUrban Design and Planning Portfolio .pdf
Urban Design and Planning Portfolio .pdf
sonam254547
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
PDF CH 1 Understansding Mechatronics.pdf
PDF CH 1 Understansding Mechatronics.pdfPDF CH 1 Understansding Mechatronics.pdf
PDF CH 1 Understansding Mechatronics.pdf
KovidAggarwal
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
Electric Motors - DC Motors - Series, Shunt, Compound, Seprately Excited, PMD...
VirajPasare
Protecting Secrets in Transparent Systems
Protecting Secrets in Transparent SystemsProtecting Secrets in Transparent Systems
Protecting Secrets in Transparent Systems
LucaBarbaro3
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLESAE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
AE- unit 5.ppt ELECTRIC AND HYBRID VEHICLES
Dr.PERIASAMY K
Energy Transition Factbook Bloomberg.pdf
Energy Transition Factbook Bloomberg.pdfEnergy Transition Factbook Bloomberg.pdf
Energy Transition Factbook Bloomberg.pdf
CarlosdelaFuenteMnde
Introduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptxIntroduction to 3D Printing Technology.pptx
Introduction to 3D Printing Technology.pptx
pprakash21252
wind energy types of turbines and advantages
wind energy types of turbines and advantageswind energy types of turbines and advantages
wind energy types of turbines and advantages
MahmudHalef
International Journal of Advanced Information Technology (IJAIT)
International Journal of Advanced Information Technology (IJAIT)International Journal of Advanced Information Technology (IJAIT)
International Journal of Advanced Information Technology (IJAIT)
ijait
Topic 3.NN and DL Hopfield Networks.pptx
Topic 3.NN and DL Hopfield Networks.pptxTopic 3.NN and DL Hopfield Networks.pptx
Topic 3.NN and DL Hopfield Networks.pptx
ManjulaRavichandran5
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptxONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
ONLINE MOBILE PRICE PREDICTION USING MACHINE LEARNING (1).pptx
balajisshetty
Artificial-Intelligence-in-Cybersecurity.pptx
Artificial-Intelligence-in-Cybersecurity.pptxArtificial-Intelligence-in-Cybersecurity.pptx
Artificial-Intelligence-in-Cybersecurity.pptx
Vigneshwarar3
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascioKtor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
Ktor - Definizioni di Path, Integrazioni, Plugin e build fino al rilascio
infogdgmi
DEMU - Power distribution final of indian railways
DEMU - Power distribution final of indian railwaysDEMU - Power distribution final of indian railways
DEMU - Power distribution final of indian railways
mishrasanjeev119
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
271094912XOULFHKBXRCVHBJKFG KMXCG HJKLMRTVBHNJMXRCVBHUINJ
QualityManager48
T32 AI Trends, Technologies, & Transformations 250323.pdf
T32 AI Trends, Technologies, & Transformations 250323.pdfT32 AI Trends, Technologies, & Transformations 250323.pdf
T32 AI Trends, Technologies, & Transformations 250323.pdf
Moustafa M Elsayed
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter SystemsUnit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
Unit-I-Water Technology.ppt (Chemistry for Electronics and Compter Systems
KrishnaveniKrishnara1

Kafka Workshop

  • 1. Kafka & message bus Robin GRAILLON & Alexandre ANDR 12/10/2016
  • 2. Synchronous Call Processing Might be long Response
  • 3. Asynchronous Call Response Post-Processing
  • 4. Message Bus Events aggregation CQRS oriented 袖S oriented Event sourcing oriented Language agnostic Multiple implementations RabbitMQ Kafka etc.
  • 5. Apache Kafka LinkedIn creation Open sourced in 2011 Filesystem oriented Wrote in Scala Highly scalable Used by big companies LinkedIn Netflix Spotify Meetic
  • 6. LinkedIn statistics 800 billion m/day 175 TB 13 million m/sec 2.75 GB 1100 kafka instances 60 clusters
  • 7. Basic workflow Producer 1 Producer 2 Producer 3 Producer X Consumer 1 Consumer 2 Consumer 3 Consumer Y Kafka Stack
  • 8. Kafka stack Zookeeper : scalability, manager Kafka broker : kafka server instance Consumer : consumes events and do things Producer : produces events (like user as connected) topic : event name partition : way to split messages between brokers
  • 9. Kafka partitions (1) For one topic (lets say astronaut.connection)
  • 10. Kafka stack & partitions
  • 12. ...but easily ! ./console run HELP run:zk run zookeeper kill:zk kill zookeeper run:kk run kafka kill:kk kill kafka producer run producer on topic consumer run consumer on topic t:c create a topic t:d delete a topic t:l list topics What do you want to do?
  • 13. Step 1: launch Zookeeper! What do you want to do? run:zk Configuration file? [./zookeeper.properties] Port? [2181] ./../bin/zookeeper-server-start.sh ./zookeeper.properties What do you want to do?
  • 14. Step 2: launch Kafka! What do you want to do? run:kk
  • 15. Step 3: list topics! What do you want to do? t:l Zookeeper host? [localhost:2181] ./../bin/kafka-topics.sh --list --zookeeper localhost:2181 What do you want to do?
  • 16. Step 4: create a topic! What do you want to do? t:c Topic name? [test] Zookeeper host? [localhost:2181] Partitions? [1] Replication factor? [1] ./../bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic test --partitions 1 --replication-factor 1 Created topic "test". What do you want to do?
  • 17. Step 5: list topics AGAIIIIN! What do you want to do? t:l Zookeeper host? [localhost:2181] ./../bin/kafka-topics.sh --list --zookeeper localhost:2181 test What do you want to do?
  • 18. Step 6: run a consumer! New terminal ! $ ./console run What do you want to do? consumer Topic name? [test] Zookeeper host? [localhost:2181] From beginning? [1] ./../bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
  • 19. Step 7: generate data! What do you want to do? g Message? [I'm an astronaut!] How many times? [1] 10000000 File? [data_10000000.txt] 10000000/10000000 [============================] 100%
  • 20. Step 8: produce events! Back to the other terminal What do you want to do? p Topic name? [test] brokers? [localhost:9092] data_10000000.txt Dataset to use? [data_10000000.txt] ./../bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test < ./data/data_10000000.txt
  • 21. GroupId: experiment 1 2 groupId 2 partitions 2 consumers
  • 22. GroupId: experiment 2 1 groupId 2 consumer
  • 23. Documentation/resources Kafka quick setup https://kafka.apache.org/quickstart Kafka at LinkedIn https://engineering.linkedin.com/kafka/running-kafka-scale Why zookeeper ? https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka