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 if the brick file of GlusterFS is missing?

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

Share

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

This article mainly introduces "how to do when the brick file of GlusterFS is lost". In the daily operation, I believe that many people have doubts about how to do when the brick file of GlusterFS is lost. The editor consulted all kinds of information and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question of "how to do when the brick file of GlusterFS is lost". Next, please follow the editor to study!

0. Test environment

GlusterFS 3.6.4/3.6.7/3.6.9

CentOS 6.7/7.1

1. Test cases and results 1

Suppose A, B copy host, C client, C mounts to A.

First create files 1 to 99 in the volume through C.

Test 1:

Delete rm-f 2 from An and execute heal full to see if it can be restored. If not, execute heal full,An on B to see if the files are restored. Do not ls on C during the operation.

Delete rm-f 3colors from A, and only see if there is a ls,C on C to see if there is any recovery on A.

Test 2:

Delete rm-f 4neighbors on A, and delete the corresponding gfid file. An executes heal full to see if it is restored, and if not, execute heal full,An on B to see if the file is restored. Do not ls on C during the operation.

Delete rm-f 5neighbors on A, and delete the corresponding gfid file. Only on C ls,C to see if there is 5 minutes on A to see if it recovers.

Test 3:

Delete rm-f 6 from B and execute heal full to see if it can be restored. If not, execute heal full,B on B to see if the file is restored. Do not ls on C during the operation.

Delete rm-f 7legs from B, and only see if there are seven cycles on ls,C on C, and see if it is restored on B.

Test 4:

Delete rm-f 8neighbors on B, and delete the corresponding gfid file. An executes heal full to see if it is restored, and if not, execute heal full,B on B to see if the file is restored. Do not ls on C during the operation.

Delete rm-f 9 files on B, and delete the corresponding gfid file. Only on C ls,C to see if there is 9 minutes on B to see if it recovers.

Test results:

Experiment one

You can see 3 * nothing else can be seen on C

Experiment two

You can see 5 on C * nothing else is good.

Experiment 3

1. Can restore 6 *

2. There is no recovery on B and C does not see 7*

Experiment 4

1. Can restore 8 *

2. 9 * on B does not recover and C does not see 9 *

2. Test cases and results 2

Add two more test cases, which need to restore snapshots to ensure that the environment is pure and reliable and then executed separately.

Suppose A, B copy host, C client, C mounts to A.

First create files 1 to 99 in the volume through C.

Scenario 1:

Delete rm * on A, and execute heal full on A to see if it can be restored. If not, execute heal full,An on B to see if the file is restored. If you can't ls on C again, see if you can see the file on C.

If not, restart the glusterd service on A, and then do the above to see the result.

Suppose A, B copy host, C client, C mounts to A.

First create files 1 to 99 in the volume through C.

Scenario 2:

Delete rm * on B and delete the corresponding gfid file. An executes heal full to see if it is restored, and if not, execute heal full,B on B to see if the file is restored. If you can't ls on C again, see if you can see the file on C.

If not, restart the glusterd service on B, and then do the above to see the result.

Test results:

Scene one

If you see the file on C, nothing else will work.

Scene two

None of it works.

3. Test summary-repair of missing copy files

When the copy file in the copy volume is accidentally deleted (and the corresponding gfid file is deleted), you can use the

Gluster volume heal VOLNAME full

Command to repair, if you do not add the full parameter, the missing copy will not be detected and no copy repair operation will be performed.

When a copy is lost, the client may or may not see the missing file, depending on the location of the mounted host.

When you can still see the missing file:

Although the missing file can be seen, the copy cannot be restored by ls or ls-l at this time, and the copy file will only be repaired when the missing file is modified again.

When the missing file cannot be seen:

1) remounting will repair the lost copy, and after repair, the client can see all the files. Obviously, online systems don't usually operate this way.

2) execute the gluster volume heal VOLNAME full command in the background to repair the missing copy file and let the client see the missing file again.

Dark file description

In the case of replicated volumes, suppose there are two brick made of volume, and when deleting a file file on one of the brick (without deleting the corresponding gfid file), it may cause (two replicas, deleting one of the replicas will result in, but the exact replica is temporarily uncertain, or it may be a non-mount point copy) the client cannot see the file, and the situation is as follows:

The client cannot see the file;. One brick has file; and the other does not have file.

At this point, the gluster volume heal full self-repair operation is performed, and the effect is the same as described above. The client cannot see the file, and the file at this time is called a dark file.

Client remount repair (sometimes remount can be repaired, you need to consider the worst-case scenario).

The server-side heal full cannot be repaired.

How do I recover dark files?

Perform ls file operations on the client side. At this point, the server-side file will also be automatically restored.

This is done on the premise that the missing file name must be known, otherwise it cannot be recovered.

Before the recovery, the client can perform touch, write and other operations on the file normally. When executed once, the server files will be automatically restored, as long as the file name must be known.

Server-side utilization is restored by cp mechanism.

Client remount repair (sometimes remount can be repaired, you need to consider the worst-case scenario).

The occurrence of dark files is a very bad thing, it is difficult to determine which copies are missing online, and remounting is basically not allowed, so try to avoid this situation.

At this point, the study of "what to do if the brick file of GlusterFS is lost" 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