How to delete Gluster volume roughly
Notes from removing a Gluster volume when disconnected peers prevent normal deletion, including the errors encountered and the cleanup performed.
updated 2 min read
These are exceptional cases.
When you want to remove volume on your Gluster cluster but everything goes down, you can't delete or even detach any peers.
root@DEV-YK[/var/db/system/glusterd]# gluster peer statusNumber of Peers: 2
Hostname: 192.168.90.9Uuid: f0a4aab8-701f-4b6a-8e68-9693d2519b4fState: Peer in Cluster (Disconnected)Other names:192.168.3.14
Hostname: 192.168.90.12Uuid: 7c693233-25cb-487d-99e4-c0bb60365c34State: Peer in Cluster (Disconnected)Other names:192.168.3.16root@DEV-YK[/var/db/system/glusterd]# gluster vol info
Volume Name: ctdb_shared_volType: DistributeVolume ID: 4e6e5bff-b937-48a1-be65-775f544d61e0Status: StoppedSnapshot Count: 0Number of Bricks: 1Transport-type: tcpBricks:Brick1: 192.168.90.11:/var/db/system/ctdb_shared_volOptions Reconfigured:nfs.disable: ontransport.address-family: inetstorage.fips-mode-rchecksum: on
Volume Name: replicated-raidz1Type: DistributeVolume ID: fdf1807f-a9f3-40b5-bb6d-6d6c51f1ce38Status: StartedSnapshot Count: 0Number of Bricks: 1Transport-type: tcpBricks:Brick1: 192.168.90.11:/mnt/cluster-raidz1/.glusterfs/replicated-raidz1/brick0Options Reconfigured:performance.client-io-threads: offnfs.disable: ontransport.address-family: inetstorage.fips-mode-rchecksum: onI can't delete volume or even detach any peers.
root@DEV-YK[~]# gluster vol delete replicated-raidz1Deleting volume will erase all information about the volume. Do you want to continue? (y/n) yvolume delete: replicated-raidz1: failed: Volume replicated-raidz1 has been started.Volume needs to be stopped before deletion.root@DEV-YK[~]# gluster vol stop replicated-raidz1Stopping volume will make its data inaccessible. Do you want to continue? (y/n) yvolume stop: replicated-raidz1: successroot@DEV-YK[~]# gluster vol delete replicated-raidz1Deleting volume will erase all information about the volume. Do you want to continue? (y/n) yvolume delete: replicated-raidz1: failed: Some of the peers are downroot@DEV-YK[~]# gluster peer statusNumber of Peers: 2
Hostname: 192.168.90.9Uuid: f0a4aab8-701f-4b6a-8e68-9693d2519b4fState: Peer in Cluster (Disconnected)
Hostname: 192.168.90.11Uuid: c5187d1b-cf86-4d96-9f37-f78c51f22aabState: Peer in Cluster (Disconnected)root@DEV-YK[~]# gluster peer detach 192.168.90.11All clients mounted through the peer which is getting detached need to be remounted using one of the other active peers in the trusted storage pool to ensure client gets notification on any changes done on the gluster configuration and if the same has been done do you want to proceed? (y/n) ypeer detach: failed: One of the peers is probably down. Check with 'peer status'Try this.
root@DEV-YK[~]# rm -rfv /var/db/system/glusterd/peers/*root@DEV-YK[~]# rm -frv /var/db/system/glusterd/vols/*Then restart glusterd service.
root@DEV-YK[~]# systemctl restart glusterdroot@DEV-YK[~]# vol infozsh: command not found: volroot@DEV-YK[~]# gluster vol infoNo volumes presentroot@DEV-YK[~]# gluster peer statusNumber of Peers: 0Voila.