[Big data] quickly become familiar with ZooKeeper

What is Zookeeper:

ZooKeeper is a distributed, open-source coordination service for distributed applications, is an open source implementation of Google's Chubby, is a key component of Hadoop and Hbase. It is to provide a consistent service for distributed applications, provides features include: configuration maintenance, domain name service, distributed synchronization, group services. 

ZooKeeper goal is to better encapsulate complex error-prone critical services, the easy to use interface and efficient performance, function and stability of the system to the user.

Zookeeper works:

Zookeeper is the core of atomic broadcast, this mechanism ensures synchronization between the various Server. Protocol Implementation of this mechanism is called Zab agreement. Zab protocol has two modes, which are recovery mode (selected from the master) and broadcast mode (synchronous). When the service starts or after leader crashes, Zab entered recovery mode, when the leader is elected, and most finished after Server synchronization and leader of the state, recovery mode is over. State synchronization ensures the leader and Server have the same system state.

In order to ensure consistency of the order of affairs, zookeeper using increasing transaction id number (zxid) to identify the transaction. All proposals (proposal) are proposed to be added when zxid. Implementation zxid is a 64-bit number that is high 32 epoch used to identify the relationship between the leader has changed every time a leader is elected, it will have a new epoch, the current logo belonging to the reign of the leader. 32 for the low counts.

Zookeeper designed to:

  • Eventual consistency: client regardless of which connect to the Server, it is presented to the same view, which is the most important performance zookeeper.
  • Reliability: simple, robust, good performance, if the message is accepted to a server, it will be acceptable to all servers.
  • Real-time: Zookeeper ensure that clients will receive updated information server within a range of time intervals, or the information server failure. However, due to network delay and other reasons, Zookeeper not guarantee that two clients can simultaneously receive data just updated, the latest data if needed, should call sync before reading data () interface.
  • Waiting is not (wait-free): slow or failure of the client shall not interfere with the client's request quickly, so that each client can effectively wait.
  • Atomicity: Update only success or failure, no intermediate state.
  • Sequence: the partial order and includes a global ordered two types: global order means that if a message before the message is posted on a server b, a message will be posted on the message before all b Server; partial order means that if a message b Post same after a message sender, a row in front of bound b.

More details about ZooKeeper:  Big Data ZooKeeper Getting Started

(This course is to help participants familiar with the zookeeper target, suitable for a certain basis of student learning.)

Ali cloud developer community fully upgraded, one-stop experience, with more cool :( Ali cloud developer community home page )

Guess you like

Origin blog.csdn.net/lsj960922/article/details/92618163