Zookeeper cluster features:
Zookeeper cluster features:
1, ZooKeeper host called leader, a slave called follwer (a leader, more followers)
2, zookeeper server clusters do all the work, more than half of server alive, zk will be able to normal operation (it is recommended that zk cluster is an odd number),
3, zk all nodes stored data is consistent with all
4, the update request order from a client requests the same order they were sent first performance understood that:
the following is a server cluster zookeeper,
server1 Server2 Server3
There are two write data (instead of 2) to enter server1, server1 is the first to write 1, 2 after write, because his data is globally consistent, so the zookeeper cluster inside each server should write these two data but due to network reasons, when the data arrives server3, is the first to reach the 2 data, after data 1 arrives, but still be able to achieve the first to write data 1, 2 after writing data, has been to follow the original order, will not change
5, the data update atomicity, a data either succeed or fail,
to understand:
that is, when the client sends a data to zk cluster, the cluster all of the machines will be executed or are executed successfully, or have failed, when returns results when successful, indicating that all of the server cluster have been updated
6, to obtain the data in real time zk
Zookeeper data structure:
Zookeeper model data structure and the like linux file system, a tree can be seen as a whole, each node becomes a znode, each 1MB znode can store data of each path can znode uniquely identified by its
The difference between linux file system is, zookeeper file system is no different files and directories, each znode either have child nodes, and can store data in a directory on the linux can store files, to save data.
Znode is "/" below the nodes, each with a unique znode on the lower path identifier.