Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

II. Characteristics and data structure of Zookeeper cluster

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Zookeeper cluster features:

Zookeeper cluster features:

1. The host of zookeeper is called leader, and the slave is called follwer (one leader, multiple followers).

2. Without all the servers in the zookeeper cluster working, and more than half of the servers survive, zk can run normally (therefore, it is recommended that the number of zk clusters be odd)

3. The data stored by all nodes in zk are all the same.

4. Update requests are carried out in order. Requests from the same client are executed at once according to the order in which they are sent.

The following are the servers of the zookeeper cluster

Server1 server2 server3

There are two pieces of write data (instead of 1Magazine 2) when entering the server1,server1, write 1 first, then write 2. Because his data is globally consistent, every server in the zookeeper cluster has to write these two pieces of data. However, due to network reasons, when the data reaches server3, data 2 arrives first, and data 1 arrives later, but it is still possible to write data 1 first, then data 2, always in the original order, and will not change.

5. the atomicity of data update, one data either succeeds or fails.

Understand:

That is, when client sends a data to the zk cluster, all the machines in the cluster will execute, either successfully or failed. When the returned result is successful, it means that all the server in the cluster has been updated.

6. Real-time access to data in zk

Data structure of Zookeeper:

The data structure model of Zookeeper is similar to that of linux file system. As a whole, it can be regarded as a tree, each node becomes a znode, each znode can store 1MB data, and each znode can be uniquely identified by its path.

The difference with the linux file system is that the file system of zookeeper has no difference between files and directories. Each znode can not only have child nodes, but also store data. Only when files can be saved in a directory on linux can files be saved.

Znode is the node under "/", and each node under znode is identified by a unique path.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report