SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
Welcome to ZooKeeper
ZooKeeper
What is Race Condition?
ZooKeeper
What is Race Condition?
Bank
Person A
Person B
ZooKeeper
What is a Deadlock?
ZooKeeper
What is a Deadlock?
ZooKeeper
Coordination?
How would email processors avoid reading same
emails?
Email Processor 1
Email Processor 2
Email Processor 3
Email1
Email 2
Email 3
……....
……....
Inbox - POP3/ IMAP
Email Id -
Timestamp -
Subject -
Status
Central
Storage
ZooKeeper
ZooKeeper Introduction
A Distributed Coordination Service for Distributed
Applications
• Exposes a simple set of primitives
• Very easy to program to
• Uses a data model like directory tree
ZooKeeper
ZooKeeper Introduction - Contd.
A Distributed Coordination Service for Distributed
Applications
• Used for
• Synchronisation
• Locking
• Maintaining configuration
• Failover management
• Coordination service that does not suffer from
• Race conditions
• Dead locks
ZooKeeper
Data Model
• Think of it as highly available file system
• znode - can have data
• JSON data
• No append operation
• Data access (read/write) is atomic - either full or error
• znode - can have children
• znodes form a hierarchical namespace
ZooKeeper
Data Model - Contd.
/
/zoo
/zoo/duck /zoo/goat /zoo/cow
ZooKeeper
• Persistent
• Ephemeral
• Sequential
Data Model - Znode - Types
ZooKeeper
Data Model - Persistent Znode
• Remains in ZooKeeper until deleted
• create /mynode my_json_data
ZooKeeper
Data Model - Ephemeral Znode
• Deleted by Zookeeper as session ends or timeout
• Though tied to client’s session but visible to everyone
• Can not have children, not even ephemeral ones
• create -e /apr9/myeph this-will-disappear
ZooKeeper
Data Model - Sequential Znode
• Creates a node with a sequence number in the name
• The number is automatically appended
create -s /zoo v
Created /zoo0000000004
create -s /zoo/ v
Created /zoo/0000000005
create -s /zoo/ v
Created /zoo/0000000007
create -s /xyz v
Created /xyz0000000006
ZooKeeper
Architecture
Runs in two modes
• Standalone:
• There is single server
• For Testing
• No High Availability
• Replicated:
• Run on a cluster of machines called an ensemble
• Uses Paxos Algorithm
• HA
• Tolerates as long as majority
ZooKeeper
• Phase 1: Leader election (Paxos Algorithm)
• The machines elect a distinguished member - leader
• The others are termed followers
• This phase is finished when majority sync their state with leader
• If leader fails, the remaining machines hold election within 200ms
• If the majority is not available at any point of time, the leader steps down
Ensemble
Architecture
ZooKeeper
Architecture - Phase 2
Client
Leader
Follower Follower Follower Follower
Write Write Successful
3 out of 4
have saved
ZooKeeper
• The protocol for achieving consensus is atomic like
two-phase commit
• Machines write to disk before in-memory
Architecture - Phase 2 - Contd.
ZooKeeper
If you have three nodes A, B, C
with A as Leader. And A dies.
Will someone become leader?
A
B C
A
B C
Leader
Election Demo
?
ZooKeeper
If you have three nodes A, B, C
with A as Leader. And A dies.
Will someone become leader?
A
B C
A
B C
Leader A
B C
Leader
A
B C
OR
Leader
Election Demo
ZooKeeper
If you have three nodes A, B, C with C as a leader
And A and B die.
Will C remain leader?
A
B C
A
B
C
Leader
C will step down. No
one will be the Leader
as majority is not
available.
Majority Demo
ZooKeeper
Imagine
We have an ensemble spread over two data centres.
A
B C
D
E F
Leader
Data Center - 1 Data Center - II
Why Do We Need Majority?
ZooKeeper
Imagine
The network between data centres got disconnected.
If we did not need majority for electing Leader,
what will happen?
A
B C
D
E F
Leader
Data Center - 1 Data Center - II
Why Do We Need Majority?
ZooKeeper
A
B C
D
E F
Leader
Data Center - 1 Data Center - II
Leader
Each data centre will have their own Leader.
No Consistency and utter Chaos.
That is why it requires majority.
Why Do We Need Majority?
ZooKeeper
Question
An ensemble of 10 nodes can tolerate a shutdown of
how many nodes?
4
ZooKeeper
• A client has list of servers in the ensemble
• It tries each until successful
• Server creates a new session for the client
• A session has a timeout period - decided by caller
Sessions
ZooKeeper
• If the server hasn’t received a request within the timeout
period, it may expire the session
• On session expiry, ephemeral nodes are deleted
• To keep sessions alive client sends pings (heartbeats)
• Client library takes care of heartbeats
Sessions - Continued
ZooKeeper
• Sessions are still valid on switching to another server
• Failover is handled automatically by the client
• Application can't remain agnostic of server reconnections -
because the ops will fail during disconnection
Sessions - Continued
ZooKeeper
Z
o
o
K
e
e
p
e
r
Servers
Available
Server?
Use Case - Many Servers - How Do They
Coordinate?
Clients
ZooKeeper
create(“/servers/duck”, ephemeral node)
create(“/servers/cow”, ephemeral node)
ls /servers
duck, cow
ls /servers
cow
ZooKeeper
Sequential consistency
Updates from any particular client are applied in the order
Atomicity
Updates either succeed or fail
Single system image
A client will see the same view of the system, The new
server will not accept the connection until it has caught up
Durability
Once an update has succeeded, it will persist and will not
be undone
Timeliness
Rather than allow a client to see very stale data, a server
will shut down
Guarantees
ZooKeeper
OPERATION DESCRIPTION
create Creates a znode (parent znode must exist)
delete Deletes a znode (mustn’t have children)
exists/ls Tests whether a znode exists & gets metadata
getACL,
setACL
Gets/sets the ACL for a znode
getChildren/ls Gets a list of the children of a znode
getData/get,
setData
Gets/sets the data associated with a znode
sync Synchronizes a client’s view of a znode with ZooKeeper
ZooKeeper
• Batches together multiple operations together
• Either all fail or succeed in entirety
• Possible to implement transactions
• Others never observe any inconsistent state
Multi Update
ZooKeeper
• Two core: Java & C
• contrib: perl, python, REST
• For each binding, sync and async available
Sync:
Async:
APIs
ZooKeeper
Watches
• Watchers are triggered only once
• For multiple notifications, re-register
Clients to get notifications when a znode changes in some
way
ZooKeeper
Watch Triggers
• The read ops exists, getChildren, getData may have watches
• Watches are triggered by write ops: create, delete, setData
• ACL operations do not participate in watches
WATCH OF …ARE
TRIGGERED
WHEN ZNODE IS…
exists created, deleted, or its data updated.
getData deleted or has its data updated.
getChildren
deleted, or its any of the child is created or
deleted
ZooKeeper
ACLs - Access Control Lists
Determines who can perform certain operations
on it.
• ACL is the combination
• authentication scheme,
• an identity for that scheme,
• and a set of permissions
• Authentication Scheme
• digest - The client is authenticated by a username & password.
• sasl - The client is authenticated using Kerberos.
• ip - The client is authenticated by its IP address.
ZooKeeper
Use Cases
• Building a reliable configuration service
• A Distributed lock service
• Only single process may hold the lock
ZooKeeper
When Not to Use?
1. To store big data because
• The number of copies == number of nodes
• All data is loaded in RAM too
• Network load of transferring all data to all
nodes
2. Extremely strong consistency
ZooKeeper
Thank you.
Zookeeper
reachus@cloudxlab.com
ZooKeeper
Design Goals
1. Simple
• A shared hierarchal namespace looks like standard file system
• The namespace has data nodes - znodes (similar to files/dirs)
• Data is kept in-memory
• Achieve high throughput and low latency numbers.
• High performance
• Used in large, distributed systems
• Highly available
• No single point of failure
• Strictly ordered access
• Synchronisation
ZooKeeper
2. Replicated - HA
The servers
• Know each other
• Keep in-memory image of State
• Transaction Logs & Snapshots - persistent
The client
• Keeps a TCP connection
• Gets watch events
• Sends heart beats.
• If connection breaks,
• connect to different server.
Design Goals
ZooKeeper
3. Ordered
The number
• Reflects the order of transactions.
• used implement higher-level abstractions, such as
synchronization primitives.
ZooKeeper stamps each update with a number
Design Goals
ZooKeeper
4. Fast
Performs best where reads are more common than writes, at
ratios of around 10:1.
Design Goals
At Yahoo!, where it was created, the throughput for a ZooKeeper
cluster has been benchmarked at over 10,000 operations per
second for write-dominant workloads generated by hundreds of
clients
ZooKeeper
r u ok?
ruok Check server state.
conf server configuration (from zoo.cfg).
envi server environment, versions and other system properties.
srvr statistics,znodes, mode (standalone, leader or follower).
stat server statistics and connected clients
srst Resets server statistics.
isro is it in read-only (ro) mode?
• Check connect to port 2181
• echo ruok | nc localhost 2181
ZooKeeper
Connect(host, timeout, Watcher handle)
okay. I will call you when needed.
handle.process(WatchedEvent : Connected)
create(“/servers/duck”, ephermal node);
ls /servers
duck,cow
Duck Server Killed 5 seconds later
ls /servers
cow
create(“/servers/cow”, ephermal node);
ZooKeeper
States
ZooKeeper
Election Demo
If you have three nodes A, B, C
And A and B die.
Will C remain Leader?
A
B C
A
B C
Leader
?
Leader
ZooKeeper
Coordination?
How would Email Processors avoid reading same
emails?
ZooKeeper
Coordination?
ZooKeeper
Getting Started
● List the znodes at the top level: ls /
● List the children of a znode brokers: ls /brokers
● Get the details about the znode: get /brokers
ZooKeeper
z
o
o
k
e
e
p
e
r
Servers
Which Server?
Use Case - Many Servers - How Do They
Coordinate?
Can’t keep list on single node
how to remove a failed
server?
ZooKeeper
Data Model - Continued
• /a/./b != /a/b
• /a/./b, /a/../b, /a//b is invalid
ZooKeeper
• Phase 2: Atomic broadcast
• All write requests are forwarded to the leader,
• Leader broadcasts the update to the followers
• When a majority have saved (persisted) the change:
• The leader commits the update
• The client gets success response
Architecture

Contenu connexe

Tendances

카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우if kakao
 
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby NodeHadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby NodeErik Krogen
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®confluent
 
Elasticsearch in Netflix
Elasticsearch in NetflixElasticsearch in Netflix
Elasticsearch in NetflixDanny Yuan
 
Need for Time series Database
Need for Time series DatabaseNeed for Time series Database
Need for Time series DatabasePramit Choudhary
 
2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료confluent
 
Improving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceImproving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceDataWorks Summit
 
ORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataDataWorks Summit
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...SANG WON PARK
 
How we solved Real-time User Segmentation using HBase
How we solved Real-time User Segmentation using HBaseHow we solved Real-time User Segmentation using HBase
How we solved Real-time User Segmentation using HBaseDataWorks Summit
 
Putting Kafka Into Overdrive
Putting Kafka Into OverdrivePutting Kafka Into Overdrive
Putting Kafka Into OverdriveTodd Palino
 
HBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBaseHBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBaseenissoz
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OGeorge Cao
 
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관제관 이
 
Apache Ambari: Past, Present, Future
Apache Ambari: Past, Present, FutureApache Ambari: Past, Present, Future
Apache Ambari: Past, Present, FutureHortonworks
 
Getting Started with Amazon Kinesis
Getting Started with Amazon KinesisGetting Started with Amazon Kinesis
Getting Started with Amazon KinesisAmazon Web Services
 

Tendances (20)

카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우
 
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby NodeHadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
Hadoop Meetup Jan 2019 - HDFS Scalability and Consistent Reads from Standby Node
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®
 
Elasticsearch in Netflix
Elasticsearch in NetflixElasticsearch in Netflix
Elasticsearch in Netflix
 
Need for Time series Database
Need for Time series DatabaseNeed for Time series Database
Need for Time series Database
 
2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료
 
Improving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of ServiceImproving HDFS Availability with IPC Quality of Service
Improving HDFS Availability with IPC Quality of Service
 
ORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big Data
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
 
How we solved Real-time User Segmentation using HBase
How we solved Real-time User Segmentation using HBaseHow we solved Real-time User Segmentation using HBase
How we solved Real-time User Segmentation using HBase
 
Putting Kafka Into Overdrive
Putting Kafka Into OverdrivePutting Kafka Into Overdrive
Putting Kafka Into Overdrive
 
Node Labels in YARN
Node Labels in YARNNode Labels in YARN
Node Labels in YARN
 
HBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBaseHBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBase
 
Apache Ranger
Apache RangerApache Ranger
Apache Ranger
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/O
 
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
마이크로서비스 아키텍처 기반의 의료정보시스템 고도화 전환사례.건국대학교병원.이제관
 
AWS RDS
AWS RDSAWS RDS
AWS RDS
 
Apache Ambari: Past, Present, Future
Apache Ambari: Past, Present, FutureApache Ambari: Past, Present, Future
Apache Ambari: Past, Present, Future
 
Getting Started with Amazon Kinesis
Getting Started with Amazon KinesisGetting Started with Amazon Kinesis
Getting Started with Amazon Kinesis
 

Similaire à Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab

Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache ZookeeperAnshul Patel
 
使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡Lawrence Huang
 
Zookeeper Tutorial for beginners
Zookeeper Tutorial for beginnersZookeeper Tutorial for beginners
Zookeeper Tutorial for beginnersjeetendra mandal
 
Benchmarking Solr Performance at Scale
Benchmarking Solr Performance at ScaleBenchmarking Solr Performance at Scale
Benchmarking Solr Performance at Scalethelabdude
 
Introduction to SolrCloud
Introduction to SolrCloudIntroduction to SolrCloud
Introduction to SolrCloudVarun Thacker
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoverySteven Francia
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...confluent
 
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopEventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopAyon Sinha
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Viet-Dung TRINH
 
London devops logging
London devops loggingLondon devops logging
London devops loggingTomas Doran
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Jimmy Lai
 
Deploying and managing Solr at scale
Deploying and managing Solr at scaleDeploying and managing Solr at scale
Deploying and managing Solr at scaleAnshum Gupta
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systexJames Chen
 
Automated Cluster Management and Recovery for Large Scale Multi-Tenant Sea...
  Automated Cluster Management and Recovery  for Large Scale Multi-Tenant Sea...  Automated Cluster Management and Recovery  for Large Scale Multi-Tenant Sea...
Automated Cluster Management and Recovery for Large Scale Multi-Tenant Sea...Lucidworks
 
Cassandra and drivers
Cassandra and driversCassandra and drivers
Cassandra and driversBen Bromhead
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...Lucidworks
 
SFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr PerformanceSFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr PerformanceLucidworks (Archived)
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACKristofferson A
 

Similaire à Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab (20)

Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache Zookeeper
 
使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡
 
Zookeeper Tutorial for beginners
Zookeeper Tutorial for beginnersZookeeper Tutorial for beginners
Zookeeper Tutorial for beginners
 
Benchmarking Solr Performance at Scale
Benchmarking Solr Performance at ScaleBenchmarking Solr Performance at Scale
Benchmarking Solr Performance at Scale
 
Introduction to SolrCloud
Introduction to SolrCloudIntroduction to SolrCloud
Introduction to SolrCloud
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster Recovery
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
 
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopEventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
 
Deploying and managing Solr at scale
Deploying and managing Solr at scaleDeploying and managing Solr at scale
Deploying and managing Solr at scale
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
 
Automated Cluster Management and Recovery for Large Scale Multi-Tenant Sea...
  Automated Cluster Management and Recovery  for Large Scale Multi-Tenant Sea...  Automated Cluster Management and Recovery  for Large Scale Multi-Tenant Sea...
Automated Cluster Management and Recovery for Large Scale Multi-Tenant Sea...
 
Cassandra and drivers
Cassandra and driversCassandra and drivers
Cassandra and drivers
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
Scaling SolrCloud to a Large Number of Collections: Presented by Shalin Shekh...
 
SFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr PerformanceSFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
 

Plus de CloudxLab

Understanding computer vision with Deep Learning
Understanding computer vision with Deep LearningUnderstanding computer vision with Deep Learning
Understanding computer vision with Deep LearningCloudxLab
 
Deep Learning Overview
Deep Learning OverviewDeep Learning Overview
Deep Learning OverviewCloudxLab
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural NetworksCloudxLab
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingCloudxLab
 
Autoencoders
AutoencodersAutoencoders
AutoencodersCloudxLab
 
Training Deep Neural Nets
Training Deep Neural NetsTraining Deep Neural Nets
Training Deep Neural NetsCloudxLab
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement LearningCloudxLab
 
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...CloudxLab
 
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLab
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLabAdvanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLab
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...CloudxLab
 
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...CloudxLab
 
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...CloudxLab
 
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLab
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLabIntroduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLab
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLabCloudxLab
 
Introduction to Deep Learning | CloudxLab
Introduction to Deep Learning | CloudxLabIntroduction to Deep Learning | CloudxLab
Introduction to Deep Learning | CloudxLabCloudxLab
 
Dimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLabDimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLabCloudxLab
 
Ensemble Learning and Random Forests
Ensemble Learning and Random ForestsEnsemble Learning and Random Forests
Ensemble Learning and Random ForestsCloudxLab
 

Plus de CloudxLab (20)

Understanding computer vision with Deep Learning
Understanding computer vision with Deep LearningUnderstanding computer vision with Deep Learning
Understanding computer vision with Deep Learning
 
Deep Learning Overview
Deep Learning OverviewDeep Learning Overview
Deep Learning Overview
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Naive Bayes
Naive BayesNaive Bayes
Naive Bayes
 
Autoencoders
AutoencodersAutoencoders
Autoencoders
 
Training Deep Neural Nets
Training Deep Neural NetsTraining Deep Neural Nets
Training Deep Neural Nets
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...
Apache Spark - Key Value RDD - Transformations | Big Data Hadoop Spark Tutori...
 
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLab
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLabAdvanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLab
Advanced Spark Programming - Part 2 | Big Data Hadoop Spark Tutorial | CloudxLab
 
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 2 | Big Data Hadoop Spark Tutori...
 
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
 
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Running on a Cluster | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to SparkR | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
Introduction to MapReduce - Hadoop Streaming | Big Data Hadoop Spark Tutorial...
 
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLab
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLabIntroduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLab
Introduction To TensorFlow | Deep Learning Using TensorFlow | CloudxLab
 
Introduction to Deep Learning | CloudxLab
Introduction to Deep Learning | CloudxLabIntroduction to Deep Learning | CloudxLab
Introduction to Deep Learning | CloudxLab
 
Dimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLabDimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLab
 
Ensemble Learning and Random Forests
Ensemble Learning and Random ForestsEnsemble Learning and Random Forests
Ensemble Learning and Random Forests
 

Dernier

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 

Dernier (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 

Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab

  • 3. ZooKeeper What is Race Condition? Bank Person A Person B
  • 6. ZooKeeper Coordination? How would email processors avoid reading same emails? Email Processor 1 Email Processor 2 Email Processor 3 Email1 Email 2 Email 3 …….... …….... Inbox - POP3/ IMAP Email Id - Timestamp - Subject - Status Central Storage
  • 7. ZooKeeper ZooKeeper Introduction A Distributed Coordination Service for Distributed Applications • Exposes a simple set of primitives • Very easy to program to • Uses a data model like directory tree
  • 8. ZooKeeper ZooKeeper Introduction - Contd. A Distributed Coordination Service for Distributed Applications • Used for • Synchronisation • Locking • Maintaining configuration • Failover management • Coordination service that does not suffer from • Race conditions • Dead locks
  • 9. ZooKeeper Data Model • Think of it as highly available file system • znode - can have data • JSON data • No append operation • Data access (read/write) is atomic - either full or error • znode - can have children • znodes form a hierarchical namespace
  • 10. ZooKeeper Data Model - Contd. / /zoo /zoo/duck /zoo/goat /zoo/cow
  • 11. ZooKeeper • Persistent • Ephemeral • Sequential Data Model - Znode - Types
  • 12. ZooKeeper Data Model - Persistent Znode • Remains in ZooKeeper until deleted • create /mynode my_json_data
  • 13. ZooKeeper Data Model - Ephemeral Znode • Deleted by Zookeeper as session ends or timeout • Though tied to client’s session but visible to everyone • Can not have children, not even ephemeral ones • create -e /apr9/myeph this-will-disappear
  • 14. ZooKeeper Data Model - Sequential Znode • Creates a node with a sequence number in the name • The number is automatically appended create -s /zoo v Created /zoo0000000004 create -s /zoo/ v Created /zoo/0000000005 create -s /zoo/ v Created /zoo/0000000007 create -s /xyz v Created /xyz0000000006
  • 15. ZooKeeper Architecture Runs in two modes • Standalone: • There is single server • For Testing • No High Availability • Replicated: • Run on a cluster of machines called an ensemble • Uses Paxos Algorithm • HA • Tolerates as long as majority
  • 16. ZooKeeper • Phase 1: Leader election (Paxos Algorithm) • The machines elect a distinguished member - leader • The others are termed followers • This phase is finished when majority sync their state with leader • If leader fails, the remaining machines hold election within 200ms • If the majority is not available at any point of time, the leader steps down Ensemble Architecture
  • 17. ZooKeeper Architecture - Phase 2 Client Leader Follower Follower Follower Follower Write Write Successful 3 out of 4 have saved
  • 18. ZooKeeper • The protocol for achieving consensus is atomic like two-phase commit • Machines write to disk before in-memory Architecture - Phase 2 - Contd.
  • 19. ZooKeeper If you have three nodes A, B, C with A as Leader. And A dies. Will someone become leader? A B C A B C Leader Election Demo ?
  • 20. ZooKeeper If you have three nodes A, B, C with A as Leader. And A dies. Will someone become leader? A B C A B C Leader A B C Leader A B C OR Leader Election Demo
  • 21. ZooKeeper If you have three nodes A, B, C with C as a leader And A and B die. Will C remain leader? A B C A B C Leader C will step down. No one will be the Leader as majority is not available. Majority Demo
  • 22. ZooKeeper Imagine We have an ensemble spread over two data centres. A B C D E F Leader Data Center - 1 Data Center - II Why Do We Need Majority?
  • 23. ZooKeeper Imagine The network between data centres got disconnected. If we did not need majority for electing Leader, what will happen? A B C D E F Leader Data Center - 1 Data Center - II Why Do We Need Majority?
  • 24. ZooKeeper A B C D E F Leader Data Center - 1 Data Center - II Leader Each data centre will have their own Leader. No Consistency and utter Chaos. That is why it requires majority. Why Do We Need Majority?
  • 25. ZooKeeper Question An ensemble of 10 nodes can tolerate a shutdown of how many nodes? 4
  • 26. ZooKeeper • A client has list of servers in the ensemble • It tries each until successful • Server creates a new session for the client • A session has a timeout period - decided by caller Sessions
  • 27. ZooKeeper • If the server hasn’t received a request within the timeout period, it may expire the session • On session expiry, ephemeral nodes are deleted • To keep sessions alive client sends pings (heartbeats) • Client library takes care of heartbeats Sessions - Continued
  • 28. ZooKeeper • Sessions are still valid on switching to another server • Failover is handled automatically by the client • Application can't remain agnostic of server reconnections - because the ops will fail during disconnection Sessions - Continued
  • 29. ZooKeeper Z o o K e e p e r Servers Available Server? Use Case - Many Servers - How Do They Coordinate? Clients
  • 30. ZooKeeper create(“/servers/duck”, ephemeral node) create(“/servers/cow”, ephemeral node) ls /servers duck, cow ls /servers cow
  • 31. ZooKeeper Sequential consistency Updates from any particular client are applied in the order Atomicity Updates either succeed or fail Single system image A client will see the same view of the system, The new server will not accept the connection until it has caught up Durability Once an update has succeeded, it will persist and will not be undone Timeliness Rather than allow a client to see very stale data, a server will shut down Guarantees
  • 32. ZooKeeper OPERATION DESCRIPTION create Creates a znode (parent znode must exist) delete Deletes a znode (mustn’t have children) exists/ls Tests whether a znode exists & gets metadata getACL, setACL Gets/sets the ACL for a znode getChildren/ls Gets a list of the children of a znode getData/get, setData Gets/sets the data associated with a znode sync Synchronizes a client’s view of a znode with ZooKeeper
  • 33. ZooKeeper • Batches together multiple operations together • Either all fail or succeed in entirety • Possible to implement transactions • Others never observe any inconsistent state Multi Update
  • 34. ZooKeeper • Two core: Java & C • contrib: perl, python, REST • For each binding, sync and async available Sync: Async: APIs
  • 35. ZooKeeper Watches • Watchers are triggered only once • For multiple notifications, re-register Clients to get notifications when a znode changes in some way
  • 36. ZooKeeper Watch Triggers • The read ops exists, getChildren, getData may have watches • Watches are triggered by write ops: create, delete, setData • ACL operations do not participate in watches WATCH OF …ARE TRIGGERED WHEN ZNODE IS… exists created, deleted, or its data updated. getData deleted or has its data updated. getChildren deleted, or its any of the child is created or deleted
  • 37. ZooKeeper ACLs - Access Control Lists Determines who can perform certain operations on it. • ACL is the combination • authentication scheme, • an identity for that scheme, • and a set of permissions • Authentication Scheme • digest - The client is authenticated by a username & password. • sasl - The client is authenticated using Kerberos. • ip - The client is authenticated by its IP address.
  • 38. ZooKeeper Use Cases • Building a reliable configuration service • A Distributed lock service • Only single process may hold the lock
  • 39. ZooKeeper When Not to Use? 1. To store big data because • The number of copies == number of nodes • All data is loaded in RAM too • Network load of transferring all data to all nodes 2. Extremely strong consistency
  • 41. ZooKeeper Design Goals 1. Simple • A shared hierarchal namespace looks like standard file system • The namespace has data nodes - znodes (similar to files/dirs) • Data is kept in-memory • Achieve high throughput and low latency numbers. • High performance • Used in large, distributed systems • Highly available • No single point of failure • Strictly ordered access • Synchronisation
  • 42. ZooKeeper 2. Replicated - HA The servers • Know each other • Keep in-memory image of State • Transaction Logs & Snapshots - persistent The client • Keeps a TCP connection • Gets watch events • Sends heart beats. • If connection breaks, • connect to different server. Design Goals
  • 43. ZooKeeper 3. Ordered The number • Reflects the order of transactions. • used implement higher-level abstractions, such as synchronization primitives. ZooKeeper stamps each update with a number Design Goals
  • 44. ZooKeeper 4. Fast Performs best where reads are more common than writes, at ratios of around 10:1. Design Goals At Yahoo!, where it was created, the throughput for a ZooKeeper cluster has been benchmarked at over 10,000 operations per second for write-dominant workloads generated by hundreds of clients
  • 45. ZooKeeper r u ok? ruok Check server state. conf server configuration (from zoo.cfg). envi server environment, versions and other system properties. srvr statistics,znodes, mode (standalone, leader or follower). stat server statistics and connected clients srst Resets server statistics. isro is it in read-only (ro) mode? • Check connect to port 2181 • echo ruok | nc localhost 2181
  • 46. ZooKeeper Connect(host, timeout, Watcher handle) okay. I will call you when needed. handle.process(WatchedEvent : Connected) create(“/servers/duck”, ephermal node); ls /servers duck,cow Duck Server Killed 5 seconds later ls /servers cow create(“/servers/cow”, ephermal node);
  • 48. ZooKeeper Election Demo If you have three nodes A, B, C And A and B die. Will C remain Leader? A B C A B C Leader ? Leader
  • 49. ZooKeeper Coordination? How would Email Processors avoid reading same emails?
  • 51. ZooKeeper Getting Started ● List the znodes at the top level: ls / ● List the children of a znode brokers: ls /brokers ● Get the details about the znode: get /brokers
  • 52. ZooKeeper z o o k e e p e r Servers Which Server? Use Case - Many Servers - How Do They Coordinate? Can’t keep list on single node how to remove a failed server?
  • 53. ZooKeeper Data Model - Continued • /a/./b != /a/b • /a/./b, /a/../b, /a//b is invalid
  • 54. ZooKeeper • Phase 2: Atomic broadcast • All write requests are forwarded to the leader, • Leader broadcasts the update to the followers • When a majority have saved (persisted) the change: • The leader commits the update • The client gets success response Architecture