[zookeeper] 1. What is zookeeper?

Zookeeper is a file system + monitoring notification mechanism. The following functions can be achieved:

  • 1. Zookeeper is a database. Provide coordination services for distributed applications.

  • 2. Zookeeper is a database with the characteristics of a file system. (The znode has a complete path, and the child nodes under the same node cannot have the same name)

  • 3. Zookeeper is a distributed database that solves the problem of data consistency.

  • 4. Zookeeper is a distributed database (watch mechanism) with publish and subscribe functions.


Zookeeper architecture:

  • / Each node under the root node is called the root node znode.
  • Data can be stored in each znode.
  • The node name under the same node cannot be repeated.


znode node type

  • PERSISTENT permanent node
  • EPHEMERAL temporary node
  • PERSISTENT_SEQUENTIAL permanent node, serialized
  • EPHEMERAL_SEQUENTIAL temporary node, serialized


Ephemeral features of temporary nodes:

  1. When the client disconnects and the session with the server ends, the node will be deleted automatically.
  2. Temporary nodes are not allowed to have child nodes.


Permanent node Persistent feature: After the

client and the server are connected, the nodes created on the server will not be deleted. The life cycle of the node does not depend on the session, and it will be deleted only when the client executes the deletion.

Guess you like

Origin blog.51cto.com/phpme/2603700