A: Zookeeper introduction

Source: Internet
Author: User
Tags zookeeper client

One: Background
---> with the rapid development of Internet technology, Enterprise computer system computing, storage capacity requirements more and more high, the simplest proof is that there are some such as: high concurrency, mass storage such words. In this context, simply rely on a small number of high-performance mainframe to complete the computing task can not meet the needs of enterprises, the enterprise's it architecture gradually from centralized to distributed transition, so-called distributed: a computational task into a number of computing units, and assigned to a number of different computers to execute, The process of calculating the results is then summarized.
---->zookeeper is an open source distributed coordination Service, unique Leader-follower cluster structure, which solves the distributed single point problem very well. It is mainly used for such scenarios as unified Naming service, configuration management, lock service, cluster management, etc.


II: The concept of zookeeper
--->zookeeper is a high performance coordination service for distributed applications, and is a highly efficient and reliable cooperative system.
---> Features include configuration maintenance, name services, distributed synchronization, and group services.
--->zookeeper's goal is to encapsulate complex, error-prone, critical services. Provides users with easy-to-use interfaces and performance-efficient, robust systems
--->zookeeper is a full-fledged subproject of Hadoop. Performance.
---> Distributed Coordination Service, it is to solve the distributed data consistency problem.

Three: The application of zookeeper service
A sequential consistency
(1) Initiating a transaction request from a client, which will eventually be applied to the zookeeper in exactly the order in which it was initiated
b atomicity
(1) The processing result of all transaction requests is consistent across all machines in the cluster.
C Single View
(1) Regardless of the client, link to the zookeeper cluster on which service, see the server data are the same.
D Reliability
(1) Once the server completes a client transaction and responds to the client, the state change to the server will be preserved. Unless another transaction modifies it.
e Real-time sex
(1) Zookeeper guarantee that the client will eventually be able to read the latest data status from the server for a period of time
F High Performance
(1) The throughput is very large, a 3-machine zookeeper cluster can reach 12.13 million QPS



Four: The application of zookeeper service scenario
(1) Publish the scheduled read.
---> One side to publish the data, the other side by some means to obtain the data.
---> Usually there are two ways of data subscription: Push mode and pull mode, push mode is generally the server actively push messages to the client. Pull mode is the client actively go to the server to obtain data (usually by the way of timed polling)
--->ZK cluster is combined with push-pull mode. The publisher publishes the data to the ZK cluster node, the subscriber tells the server by some means, I am interested in where the node's data, the server when the data of these nodes changes, notifies the client, the client receives the notification can go to the server to obtain the data information.

(2) Load balancing
(3) Naming services
(4) Distributed coordination/notification
---> Heartbeat detection
(5) Cluster Management
(6) Master election
(7) Distributed lock
(8) Distributed queue

V: Zookeeper's design goals
Zookeeper is committed to providing a high performance, highly available, and distributed coordination service with strict sequential access control capabilities, primarily written in strict order. High performance enables zookeeper to be used in large distributed systems that have clear requirements for system throughput, and high availability makes distributed single-point issues a good solution, while strict sequential access control enables clients to implement complex synchronization primitives based on zookeeper.


Goal One: A simple data model
--->zookeeper enables distributed programs to coordinate with each other through a shared, tree-structured namespace. The name space of the tree structure mentioned here refers to a data model in Zookeeper server memory, in particular a series of data nodes called Znode, in general, the data model is similar to a file system, and the hierarchical relationship between Znode, like the file system directory structure. Unlike traditional disk file systems, however, zookeeper stores the full amount of data in memory, which is designed to increase server throughput and reduce latency.


Goal Two: You can build a cluster
---> A zookeeper cluster is usually made up of a group of machines that can form a usable zookeeper cluster.

---> Each machine that makes up the zookeeper cluster maintains the current server state in memory, and each machine maintains communication with one another. It is worth mentioning that as long as more than half of the machines in the cluster can work properly, the whole cluster will be able to serve the external services.
--->zookeeper client program chooses to create a TCP connection with any machine in the cluster, and once the link between the client and a zookeeper server disconnects, the client automatically links to the other machines in the cluster.


Goal Three: Sequential access
---> For each update request from the client, zookeeper assigns a globally unique incrementing number that reflects the sequencing of all transactional operations, and the application can use this feature of zookeeper to achieve a higher level of synchronization primitives.


Goal Four: High performance
---> Because zookeeper stores the full amount of data in memory and serves all non-transactional requests directly to the client, it is particularly useful for read-based scenarios where the author has 13 3.4.3 versions of zookeeper servers that compose a cluster for performance testing, 100% The test results of the read request are 12-13w QPS.

A: Zookeeper introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.