What are the characteristics of ZooKeeper nodes
This article is to share with you what the features of ZooKeeper nodes are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
ZooKeeper is a coordination service for distributed applications. It exposes a set of simple API based on which distributed applications can be used for synchronization, node status, configuration and other information, service registration and other information. It is written by JAVA and supports clients in both JAVA and C.
The key name of the same level node is unique
Example:
$ls / $create / runoob 2
The / runoob node already exists, and creating it again will prompt you that it already exists.
When creating a node, you must take the full path with you
Example:
$ls / runoob$ create / runoob/child 0$ create / runoob/child/ch01 0Zookeeper Node characteristics introduction Zookeeper Node characteristics introduction session shutdown, temporary node cleanup
Example:
$ls / runoob$ create-e / runoob/echild 0
At the same time, Terminal 2 looks at the node:
$ls / runoob
After ctrl+c closes the connection of the terminal, the query terminal 2 / runoob/echild node disappears.
$ls / runoob automatically creates sequential nodes
Example:
$create-s-e / runoob 0Zookeeper node characteristics introduction Zookeeper node characteristics introduction watch mechanism, listening for node changes
The event monitoring mechanism is similar to the observer mode. The watch process is that the client registers a watcher on the path of a node on the server, and the client also stores a specific watcher. When the node data or child node changes, the server notifies the client and the client carries out callback processing. Special note: after the listening event is triggered once, the event is invalidated.
Tip: refer to the common command chapter get command to monitor the use of watch, the later chapter will introduce the principle of watch implementation in detail.
The delete command can only be deleted layer by layer.
Example:
$ls / $delete / runoob
* * Tip: * * the new version can be deleted recursively through the deleteall command.
With the above many node features, zookeeper can not develop different classic application scenarios, such as:
Data publish / subscribe load balancing distributed coordination / notification cluster management cluster management master management distributed lock distributed queue
Thank you for reading! This is the end of this article on "what are the characteristics of ZooKeeper nodes?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!