2016-07-27 105 views
0

我已經創建並啓動了一些GlusterFS(3.7.11版)卷,經過一些測試後,我停止手動刪除這些卷,但它們仍保留在GlusterFS服務器中。如何完全刪除GlusterFS卷

例如,我有3臺服務器,並在/ GFS保存磚:

[[email protected] ~]$ sudo gluster volume create test-vol gfs-server-1:/gfs/test-vol gfs-server-2:/gfs/test-vol gfs-server-3:/gfs/test-vol force 
volume create: test-vol: success: please start the volume to access data 
[[email protected] ~]$ sudo gluster volume start test-vol 
volume start: test-vol: success 
[[email protected] ~]$ mkdir /tmp/test 

[[email protected] ~]$ sudo mount -t glusterfs gfs-server-1:/test-vol /tmp/test 

[[email protected] ~]$ sudo touch /tmp/test/`date +%s`.txt 
[[email protected] ~]$ sudo touch /tmp/test/`date +%s`.txt 
[[email protected] ~]$ sudo touch /tmp/test/`date +%s`.txt 
[[email protected] ~]$ sudo touch /tmp/test/`date +%s`.txt 

[[email protected] ~]$ sudo ls /tmp/test/ 
1469617442.txt 1469617446.txt 1469617447.txt 1469617449.txt 
[[email protected] ~]$ ls /gfs/test-vol/ 
1469617449.txt 
[[email protected] ~]$ sudo umount /tmp/test 

刪除卷後,我仍然可以看到該文件保留在GlusterFS服務器:

[[email protected] ~]$ sudo gluster volume stop test-vol 
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y 
volume stop: test-vol: success 

[[email protected] ~]$ sudo gluster volume delete test-vol 
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y 
volume delete: test-vol: success 

[[email protected] ~]$ ls /gfs/test-vol/ 
1469617449.txt 

回答

1

gluster volume delete不會從後端刪除數據,您需要手動從磚塊中刪除它們。 (RM -rf/GFS /測試體積/)

0

若要從後端,你需要將其刪除手動,例如在你的情況下,你需要做的 rm -rf /gfs/test-vol/

1

可以掛載的數據音量,例如/mnt/data,然後使用rm -rf /mnt/data/*。然後從gluster中刪除音量。