Zookeeper Introductory Learning (i.) Characteristics of--zookeeper

Source: Internet
Author: User
Tags zookeeper
first, the characteristics of zookeeper 1. Open Source Code 2, distributed coordination services, can solve the problem of distributed data consistency:(1) Sequential consistency (2) atomicity (3) Single view (4) Reliability (5) real-time performance 3. High Performance second, zookeeper application scenario (including but not limited to the following scenarios) 1. Data Release/Subscription
ZK uses a combination of push mode and pull mode
2. Load Balancing(1) First DB at startup, will be in the ZK to register themselves as a temporary node (ZK contains temporary node and permanent node two, temporary node in the event of a server problem, the node will be automatically removed from ZK, to ensure that the ZK server list is the latest available list) (2) When the client needs to read and write data to the zookeeper to get all the available DB link information (3) the client randomly selects a DB to establish a connection with (4) when the client discovers that the connection is unavailable, it can retrieve the available DB connection information from ZK again. You can also delete this unavailable connection from the previously obtained list and then randomly select a db to connect to it. 3. Naming Service
There are two kinds of traditional naming, the first is the self-growth ID of the database table, but not for the distributed system, the second is the UUID, can be used in the distributed system, but there is no rule, not conducive to understanding.
ZK can generate an ID that is easy to understand in order to grow in a distributed environment
4. Distributed Coordination \ Notification
Heartbeat detection, in ZK we can register all machines as a temporary node (according to the characteristics of the temporary node), when it is necessary to determine whether a machine is available, only need to determine whether the node in the ZK exists, thereby reducing the complexity of the system
Iii. Basic concepts of zookeeper 1. Cluster roleLeader server is the core of the whole zookeeper cluster working mechanism follower server is the follower of Zookeeper cluster state Observer server acts as an observer 2. Session
The client connects to the zookeeper server, and the session in the zookeeper is called sessions. The client initiates a long TCP connection with the server to maintain a session through which the client can save a valid session with the server through heartbeat detection, and can send requests and receive responses like the ZK server.
3. Data node(1) A machine in a cluster is called a node

(2) Data unit Znode in the data model, divided into persistent nodes and temporary nodes

Zookeeper data model is a tree, where the node of the tree is the Znode,znode can save information 4, version

Number of modifications used to record node data or node or child node lists or permission information
(1) Version: The current data node content revision number (2) Cversion: The Current Data node node of the version number (3) Aversion: Current data nodes ACL change version number 5, Watcher
Zookeeper allows the user to register some watcher on the specified node, and when the data node changes, the Zookeeper server sends the notification of the change to the interested client
6. ACL (access control Lists) permission controls

The

Zookeeper uses an ACL policy for permission control, with the following permissions: (1) Create: Permissions for creating child nodes (2) READ: Get Node Data and Node list permissions (3) WRITE: Permissions to update node data (4) Delete: Delete child node permissions (5) ADMIN: Set permissions for node ACLs

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.