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

What is the principle of GlusterFS replication volume repair?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "what is the principle of GlusterFS replication volume repair". In daily operation, I believe that many people have doubts about what the principle of GlusterFS replication volume repair is. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the principle of GlusterFS replication volume repair?" Next, please follow the editor to study!

Split brain

The so-called brain fissure means that two or more nodes "think" that they are normal nodes and "blame" each other, resulting in the failure to select the correct node to take over or repair, resulting in the state of brain fissure. This phenomenon occurs in high availability scenarios such as data repair, cluster management, and so on.

The redundant mirror of Glusterfs (hereinafter referred to as AFR) provides the function of data copy, which can work normally even if there is only one redundant node without interrupting the upper application. When the node is restored, the data can be repaired to a consistent state to ensure the security of the data.

How AFR works

AFR data repair mainly involves three aspects: ENTRY,META,DATA, we take the DATA repair with redundancy of 2, that is, two copies An and B, as an example. The record that describes the status of the copy is called ChangeLog, which is recorded in the extended attributes of each copy file, and reads into memory to determine whether it needs to be repaired and which copy is to be repaired for Source. The initial and normal values are 0. (note: ENTRY and META,DATA distributions correspond to a numerical value).

The steps of Write can be broken down into:

1) issue the Write operation.

2) add lock Lock.

3) add 1 to the ChangeLog of the copy of An and B, respectively, and record it in the extended attribute of each copy.

4) write to the copy of A _ meme B.

5) if the copy is successfully written, the ChangeLog is minus 1. If the copy fails, the ChangLog value remains unchanged and recorded in the extended attributes of each copy.

6) unlock UnLock.

7) return to the upper layer and return success as long as one copy is successfully written.

The above is a complete transaction action in AFR. Several states of the replica are determined based on the values of the ChangeLog recorded by the two copies:

1) WISE, intelligent, that is, the corresponding value of the other party in the ChangeLog of the copy is greater than 0 and the corresponding value of itself is equal to 0.

2) INNOCENT, innocent, that is, the ChangeLog on the copy blames neither the other party nor himself, and the ChangeLog is all 0.

3) FOOL, stupid, that is, the ChangeLog on the copy is to blame himself.

4) IGNORANT, ignored, that is, the ChangeLog of the copy is lost.

Therefore, in general, a copy of WISE will be selected as the Sourse for repair. But when both nodes are in the WISE state, there is the infamous state of brain fissure.

AFR cerebral fissure

If a brain fissure occurs when both copies are WISE, in which scenario will a brain fissure occur? Let's take a simple example with a redundancy of 2:

Two copies of a file X are located on physical machine An and physical machine B. processes an and b running on An and B respectively continue to write different operations to file X through the clients on their respective physical machines. Then the network between physical machines An and B is interrupted, because AFR can still not interrupt the upper layer application in the case of one copy, so process an and process b will continue to run, but because of network interruption, the copy data of file X on An and B are no longer consistent and both think that the other is abnormal. When the network is restored, the two copies "blame" each other, that is, brain cracks occur.

Of course, this is one of the scenarios where brain fissure occurs, sometimes it is possible to have a brain fissure, and sometimes it is inevitable to have a brain fissure. Brain fissure, which is also an issue of concern to many people, cannot be generalized.

With regard to brain fissure, different scene processing methods are also different, and even some scenes of brain fissure can not be avoided, can only try to avoid the occurrence of brain fissure.

How to prevent brain fissure

To prevent brain cracking, you can configure server-side and client-side arbitration mechanisms.

Comparison of client-side and server-side arbitration can be seen: GlusterFS client-side and server-side arbitration mechanism comparison.

At this point, the study on "what is the principle of GlusterFS replication volume repair" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report