0.實驗前的環境檢查與配置
[student@workstation ~]$ lab selfheal setup
1.存儲檢測
gluster volume heal replvol info進行恢復性文件檢測。
[root@serverb ~]# gluster volume heal replvol info
Brick servera:/bricks/brick-a1/brick
Status: Transport endpoint is not connected
Brick serverb:/bricks/brick-b1/brick
/file2
/
/file3
/file5
/file7
/file11
/file13
/file17
/file19
/file23
/file29
/file31
/file37
/file41
/file43
/file47
/file53
/file59
/file61
/file67
/file71
/file73
/file79
/file83
/file89
/file97
Number of entries: 26
2.節點啓動
servera節點會關閉。重新啓動節點。ssh root@servera重新登陸。
[root@servera ~]# Connection to servera closed by remote host.
Connection to servera closed.
[kiosk@foundation0 ~]$ ssh root@servera
Last login: Wed Jan 30 20:20:58 2019 from 172.25.250.250
3.存儲檢測
gluster volume heal replvol info進行恢復性文件檢測。
[root@servera ~]# gluster volume heal replvol info
Brick servera:/bricks/brick-a1/brick
Number of entries: 0
Brick serverb:/bricks/brick-b1/brick
/file2
/ - Possibly undergoing heal
/file3
/file5
/file7
/file79 - Possibly undergoing heal
/file83
/file89
/file97
/file83
Number of entries: 10
4.重置存儲卷
gluster volume info replvol查看存儲卷信息。gluster volume replace-brick replvol 替換存儲卷。
[root@servera ~]# gluster volume info replvol
Volume Name: replvol
Type: Replicate
Volume ID: 9ee45782-9a79-4781-8d1d-25f2c93bba2e
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
performance.readdir-ahead: on
[root@servera ~]# gluster volume replace-brick replvol \
> servera:/bricks/brick-a1/brick \
> servera:/bricks/brick-a2/brick commit force
volume replace-brick: success: replace-brick commit force operation successful
5.任務測評
lab selfheal grade進行任務測評。主要包括:添加新存儲條,移除舊存儲條,確認存儲條數量等。
[student@workstation ~]$ lab selfheal grade
Grading the student's work:
· Checking for new brick in replvol........................... PASS
· Checking for removal of old brick in replvol................ PASS
· Checking number of bricks in replvol........................ PASS
Overall lab grade.............................................. PASS