HadoopZookeeper

Hadoop Zookeeper Basics

What is Apache Zookeeper?

  • Hadoop Zookeeper is a machine that provides distributed configuration service for distributed application
  • Used for Synchronization, serialisation and coordination
  • Uses a data model like directory tree and very easy to program

Zookeeper Goals?

  • Zookeeper stores information in tree like structure
  • It has a shared hierarchical namespace looks like standard file system.
  • The namespace has data nodes called Znodes.default size is 1MB.
  • Data is kept in memory
  • A file can store data and reference to other Znodes.
  • Zookeeper is fast and can handle high loads
  • Zookeeper is relaible
  • Zookeeper is highly available and no single point of failure
  • The client connects through TCP connection and keep getting heartbeat. if one server is not available then connect to a different server
  • Zookeeper flags each update with a number
  • Zookeeper performance is best where reads are more common than write

Install Zookeeper from below link:
Install Zookeeper
 

 Zookeeper data flags:

  • Sequence
    • The path name will have increasing counter relative to the parent appended
  • Ephemeral
    • The Znode will be deleted if the session is closed or times out or if explicitly deleted

 Zookeeper Watches:

  • Zookeeper provides a feature to client to receive notification if anything changed like configuration data , connection fail etc.
  • It is not automatic and needs to be triggered by the client for first time
  • Client should verify the state after receiving notification

Zookeeper Stat Structure:

czxid The zxid of the change due to which the znode is created
mzxid The zxid of the change that last modified this znode.
ctime the time in millisecond when znode was created
mtime the time in millisecond when znode was last modified
version The number of changes to the data of this znode
cversion The number of changes to the children of this znode
aversion The number of changes to the ACL of this znode
ephemeralowner The sessionid of the owner of znode
datalength The length of data fields in znode
numchildren The no of children for this znode

Zookeeper Quorum:

  • All servers store a copy of data
  • A leader server is selected at startup
  • Followers service clients,all updates go through leader server
  • Update responses are sent when changes applied to majority of servers

© 2015, www.techkatak.com. All rights reserved.