ZOOKEEPER. CONTENTS ZooKeeper Overview ZooKeeper Basics ZooKeeper Architecture Getting Started with ZooKeeper.

Slides:



Advertisements
Similar presentations
Paxos and Zookeeper Roy Campbell.
Advertisements

P. Hunt, M Konar, F. Junqueira, B. Reed Presented by David Stein for ECE598YL SP12.
Apache ZooKeeper By Patrick Hunt, Mahadev Konar
Wait-free coordination for Internet-scale systems
Two phase commit. Failures in a distributed system Consistency requires agreement among multiple servers –Is transaction X committed? –Have all servers.
HUG – India Meet November 28, 2009 Noida Apache ZooKeeper Aby Abraham.
Failure Detection The ping-ack failure detector in a synchronous system satisfies – A: completeness – B: accuracy – C: neither – D: both.
Chubby Lock server for distributed applications 1Dennis Kafura – CS5204 – Operating Systems.
DISTRIBUTED SYSTEMS II REPLICATION CNT. II Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Flavio Junqueira, Mahadev Konar, Andrew Kornev, Benjamin Reed
1 Principles of Reliable Distributed Systems Tutorial 12: Frangipani Spring 2009 Alex Shraer.
CS 582 / CMPE 481 Distributed Systems
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 1: Introduction to Windows Server 2003.
CSS490 Replication & Fault Tolerance
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Distributed Systems 2006 Group Membership * *With material adapted from Ken Birman.
Presented by: Alvaro Llanos E.  Motivation and Overview  Frangipani Architecture overview  Similar DFS  PETAL: Distributed virtual disks ◦ Overview.
WORKFLOW IN MOBILE ENVIRONMENT. WHAT IS WORKFLOW ?  WORKFLOW IS A COLLECTION OF TASKS ORGANIZED TO ACCOMPLISH SOME BUSINESS PROCESS.  EXAMPLE: Patient.
1 The Google File System Reporter: You-Wei Zhang.
MAHADEV KONAR Apache ZooKeeper. What is ZooKeeper? A highly available, scalable, distributed coordination kernel.
1 © NOKIA Web Service Reliability NOKIA. 2 © NOKIA Content What is reliability ? Guaranteed Delivery Duplicate Elimination Ordering Crash tolerance State.
Oracle10g RAC Service Architecture Overview of Real Application Cluster Ready Services, Nodeapps, and User Defined Services.
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
INSTALLING MICROSOFT EXCHANGE SERVER 2003 CLUSTERS AND FRONT-END AND BACK ‑ END SERVERS Chapter 4.
Data Management Kelly Clynes Caitlin Minteer. Agenda Globus Toolkit Basic Data Management Systems Overview of Data Management Data Movement Grid FTP Reliable.
FailSafe SGI’s High Availability Solution Mayank Vasa MTS, Linux FailSafe Gatekeeper
Chapter 3: Services of Network Operating Systems Maysoon AlDuwais.
MapReduce and GFS. Introduction r To understand Google’s file system let us look at the sort of processing that needs to be done r We will look at MapReduce.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Architecture.
Oracle's Distributed Database Bora Yasa. Definition A Distributed Database is a set of databases stored on multiple computers at different locations and.
Eduardo Gutarra Velez. Outline Distributed Filesystems Motivation Google Filesystem Architecture The Metadata Consistency Model File Mutation.
GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based.
Fault Tolerant Services
Introduction to ZooKeeper. Agenda  What is ZooKeeper (ZK)  What ZK can do  How ZK works  ZK interface  What ZK ensures.
- Manvitha Potluri. Client-Server Communication It can be performed in two ways 1. Client-server communication using TCP 2. Client-server communication.
Chapter 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
 Introduction  Architecture NameNode, DataNodes, HDFS Client, CheckpointNode, BackupNode, Snapshots  File I/O Operations and Replica Management File.
ERICSON BRANDON M. BASCUG Alternate - REGIONAL NETWORK ADMINISTRATOR HOW TO TROUBLESHOOT TCP/IP CONNECTIVITY.
Replication Improves reliability Improves availability ( What good is a reliable system if it is not available?) Replication must be transparent and create.
Motivation Large-scale distributed application require different forms of coordination: Configuration Group membership and leader election Synchronization.
Highly Available Services and Transactions with Replicated Data Jason Lenthe.
The Raft Consensus Algorithm Diego Ongaro and John Ousterhout Stanford University.
Zookeeper Wait-Free Coordination for Internet-Scale Systems.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
Distributed File System. Outline Basic Concepts Current project Hadoop Distributed File System Future work Reference.
Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Amazon’s Dynamo Lecturer.
Apache ZooKeeper CMSC 491 Hadoop-Based Distributed Computing Spring 2016 Adam Shook.
Domain Name System The Technology Context Presentation.
Detour: Distributed Systems Techniques
강호영 Contents ZooKeeper Overview ZooKeeper’s Performance ZooKeeper’s Reliability ZooKeeper’s Architecture Running Replicated ZooKeeper.
Event Based Systems Time and synchronization (II), CAP theorem and ZooKeeper Dr. Emanuel Onica Faculty of Computer Science, Alexandru Ioan Cuza University.
Sanjay Ghemawat, Howard Gobioff, Shun-Tak Leung
Coordination and Agreement
Replicated LevelDB on JBoss Fuse
ZooKeeper Claudia Hauff.
Introduction to HDFS: Hadoop Distributed File System
Introduction to Apache ZooKeeper™
Replication Middleware for Cloud Based Storage Service
Viney Sindhu Dr. Yanqing Zhang
GARRETT SINGLETARY.
Replication Improves reliability Improves availability
Active replication for fault tolerance
Wait-free coordination for Internet-scale systems
CS 345A Data Mining MapReduce This presentation has been altered.
ZooKeeper Justin Magnotti 9/19/18.
Implementing Consistency -- Paxos
IS 698/800-01: Advanced Distributed Systems Membership Management
Pig Hive HBase Zookeeper
Presentation transcript:

ZOOKEEPER

CONTENTS ZooKeeper Overview ZooKeeper Basics ZooKeeper Architecture Getting Started with ZooKeeper

ZOOKEEPER OVERVIEW ZooKeeper? A high-performance coordination service for distributed applications (naming, configuration management, synchronization, and group Services) Used to implement consensus, group management, leader election, and presence protocols Runs in Java and has bindings for both Java and C Features of ZooKeeper Shared hierarchical namespace: consists of znodes (data registers) in memory High performance: can be used in large, distributed systems Reliability: keeps from being a single point of failure Strict ordered access: sophisticated synchronization primitives can be implemented at the client (Zookeeper stamps each update with a number) Replication: replicated itself over a sets of hosts called an ensemble

MASTER-WORKER APPLICATION Master crashes If the master is faulty and becomes unavailable, the system cannot allocate new tasks or reallocate tasks from workers that have also failed. Worker crashes If a worker crashes, the tasks assigned to it will not be completed. Communication failures If the master and a worker cannot exchange messages, the worker might not learn of new tasks assigned to it.

REQUIREMENTS FOR MASTER- WORKER ARCHITECTURE Master election It is critical for progress to have a master available to assign tasks to workers. Crash detection The master must be able to detect when workers crash or disconnect. Group membership management The master must be able to figure out which workers are available to execute tasks. Metadata management The master and the workers must be able to store assignments and execution statuses in a reliable manner.

ZOOKEEPER BASICS ZooKeeper does not expose primitives directly. Instead, it exposes a file system-like API comprised of a small set of calls. Recipes : ZooKeeper operations that manipulate small data nodes, called znodes, that are organized hierarchically as a tree, just like in a file system.

API OVERVIEW A znode contains any data as a byte array. ZooKeeper does not allow partial writes or reads of the znode data ZooKeeper API create /path data delete /path exists /path setData /path data getData /path getChildren /path

DIFFERENT MODES FOR ZNODES Persistent znodes Can be deleted only through a call to delete Ephemeral znodes Can be deleted if the client that created it crashes or closes its connection to ZooKeeper Sequential znodes A sequential znode is assigned a unique, monotonically increasing integer. To summarize, there are four options for the mode of a znode persistent, ephemeral, persistent_sequential, ephemeral_sequential

WATCHES AND NOTIFICATIONS

VERSIONS

ZOOKEEPER ARCHITECTURE

ZOOKEEPER QUORUMS In quorum mode, ZooKeeper replicates its data tree across all servers in the ensemble. In public administration, a quorum is the minimum number of legislators required to be present for a vote. For instance, We have five ZooKeeper servers, but a quorum of three. So long as any three servers have stored the data, the client can continue, and the other two servers will eventually catch up and store the data.

SESSIONS Before executing any request against a ZooKeeper ensemble, a client must establish a session with the service. It uses a TCP connection to communicate with the server, but the session may be moved to a different server if the client has not heard from its current server for some time. Sessions offer order guarantees, which means that requests in a session are executed in FIFO (first in, first out) order. Typically, a client has only a single session open, so its requests are all executed in FIFO order.

STATES AND THE LIFETIME OF A SESSION The lifetime of a session corresponds to the period between its creation and its end. Timeout Server side: If the service does not see messages associated to a given session during time t, it declares the session expired Client side: If it has heard nothing from the server at 1/3 of t, it sends a heartbeat message to the server. At 2/3 of t, the ZooKeeper client starts looking for a different server, and it has another 1/3 of t to find one.

EXAMPLE OF CLIENT RECONNECTING

ZOOKEEPER WITH QUORUMS

IMPLEMENTING A PRIMITIVE: LOCKS WITH ZOOKEEPER Here we discuss a simple recipe just to illustrate how applications can use ZooKeeper. Process We have n processes trying to acquire a lock. To acquire a lock, each process tries to create a znode, say /lock as ephemeral type. If p succeeds in creating the znode, it has the lock and can proceed to execute its critical section. Other processes that try to create /lock fail watch for changes to /lock and try to acquire the lock again once they detect that /lock has been deleted.

IMPLEMENTATION OF A MASTER-WORKER EXAMPLE we will implement some of the functionality of the master-worker example using the zkCli tool. Master The master watches for new workers and tasks, assigning tasks to available workers. Worker Workers register themselves with the system, to make sure that the master sees they are available to execute tasks, and then watch for new tasks. Client Clients create new tasks and wait for responses from the system.

THE MASTER ROLE(1/2)

THE MASTER ROLE(2/2)

THE WORKER ROLE

THE CLIENT ROLE(1/2)

THE CLIENT ROLE(2/2)

CONCLUSION ZooKeeper Overview A high-performance coordination service for distributed applications ZooKeeper Basics exposes a file system-like API Watches and Notifications ZooKeeper Architecture Quorums, Session