ZooKeeper development manual Chinese Translation
The official ZooKeeper document translated by yourself. If you need it, please correct it if you have any translation errors.
Directory
ZooKeeper Data Model
ZNodes
Time in ZooKeeper
ZooKeeper state Structure (Stat Structure)
ZooKeeper Sessions
ZooKeeper Watches
Use ACL to control ZooKeeper Access Permissions
ACL permission
Built-in ACL Mode
ZooKeeper C client API
Plug-in-type ZooKeeper Authentication
Consistency assurance
Programming Interface
FAQs and faults
Steve sun blog address: http://sundiontheway.github.io/blog
-------------------------------------- Split line --------------------------------------
ZooKeeper cluster configuration
Use ZooKeeper to implement distributed shared locks
Distributed service framework ZooKeeper-manage data in a distributed environment
Build a ZooKeeper Cluster Environment
Test Environment configuration of ZooKeeper server cluster
ZooKeeper cluster Installation
-------------------------------------- Split line --------------------------------------
This article assumes that you already have basic knowledge about distributed computing. You will see the following content in the first part:
ZooKeeper Data Model
ZooKeeper Sessions
ZooKeeper Watches
Consistency Guarantees)
The following four sections describe the actual application of program development:
Create a module-ZooKeeper operation guide
Programming Language Interface
A simple example shows the program structure.
FAQs and faults
The appendix in this article contains useful information related to ZooKeeper.
ZooKeeper Data Model
ZooKeeper has a naming system similar to a distributed file system. The difference is that Zookeeper can have data for each node or sub-node. The Node path is an absolute path separated by diagonal lines. Note that there is no relative path. Any unicode character that meets the following requirements can be used as a node path:
NULL characters cannot appear in the path name
The following characters cannot appear: \ u0001-\ u0019 and \ u007F-\ u009F
The following characters are not allowed: \ ud800-uF8FFF, \ uFFF0-uFFFF, \ uXFFFE-\ uXFFFF (where X is a digit 1-E), \ uF0000-\ uFFFFF
Character ". "can be part of a name, ". "and ".. "cannot be used separately as relative paths. The following usage is invalid:"/a/B /. /c "or"/a/B /.. /c"
"Zookeeper" is a reserved character
ZNodes
The node in the ZooKeeper tree is called znode. Each znode maintains a set of versions used to mark changes in data and access permissions. The status structure composed of these versions has a timestamp. Zookeeper uses version numbers and timestamps to verify the cache status and adjust updates. The znode version number increases every time the data in znode changes. For example, when a client recovers data, it receives the data of this version. When a client submits an update or deletes a record, it must also provide the version of the znode's currently changing data. If this version does not match the current version, the submission is invalid. _ Tips: in a distributed program, a byte point can represent a common host, server, a member in the cluster, and a client program. However, in Zookeeper, znode represents the data node, and Servers represents the machines that constitute the Zookeeper service; quorum peers refer to the servers that make up an ensemble; the client represents any host or program that uses the ZooKeeper service.
As the most important information for program development, znode has several features that require special attention:
The Watches client can set Watch on znode. Znode changes will trigger watch and then clear watch. When a watch is triggered, Zookeeper sends a notification to the client.