How to start and stop a GlusterFS volume

Stopping the wrong GlusterFS volume during maintenance makes mounted clients return I/O errors even though the brick data still exists. The target name, client activity, and brick state need to be clear before gluster volume start or gluster volume stop changes the volume state across the storage pool.

The gluster CLI sends volume state changes to glusterd from any trusted-pool node. Starting a volume launches the brick processes for that volume, while stopping a volume takes those brick processes out of service and leaves the volume definition and brick directories intact.

A stopped volume can still appear in gluster volume info with its brick layout, but clients cannot use it until the volume is started again. The stop command asks for confirmation by default; use --mode=script only in automation that has already checked the target volume and drained client access.

Steps to start and stop a GlusterFS volume:

  1. Open a terminal on a node in the trusted storage pool.
  2. List available volumes to confirm the target name.
    $ sudo gluster volume list
    volume1
    archive1
  3. Check the current state and brick layout for the target volume.
    $ sudo gluster volume info volume1
    
    Volume Name: volume1
    Type: Replicate
    Status: Stopped
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/srv/gluster/brick1/volume1
    Brick2: node2:/srv/gluster/brick1/volume1
  4. Start the volume when it should serve client I/O.
    $ sudo gluster volume start volume1
    volume start: volume1: success

    A volume must be started before clients mount it. Starting an already started volume returns an error instead of changing the brick layout.

  5. Confirm that the volume reports Started.
    $ sudo gluster volume info volume1
    
    Volume Name: volume1
    Type: Replicate
    Status: Started
    Number of Bricks: 1 x 2 = 2
    ##### snipped #####
  6. Check that the expected brick processes are online.
    $ sudo gluster volume status volume1
    Status of volume: volume1
    Gluster process                             TCP Port  RDMA Port  Online  Pid
    ------------------------------------------------------------------------------
    Brick node1:/srv/gluster/brick1/volume1      49152     0          Y       23114
    Brick node2:/srv/gluster/brick1/volume1      49153     0          Y       22987
    Self-heal Daemon on node1                    N/A       N/A        Y       23201
    Self-heal Daemon on node2                    N/A       N/A        Y       23055
    
    Task Status of Volume volume1
    ------------------------------------------------------------------------------
    There are no active volume tasks
  7. Check for connected clients before stopping the volume.
    $ sudo gluster volume status volume1 clients
    Client connections for volume volume1
    ----------------------------------------------
    Brick : node1:/srv/gluster/brick1/volume1
    Clients connected : 0
    ----------------------------------------------
    Brick : node2:/srv/gluster/brick1/volume1
    Clients connected : 0
    ----------------------------------------------

    Move application traffic away and unmount remaining clients before stopping a production volume. Active clients can see write failures and may need remounting after the volume returns.

  8. Stop the volume and confirm the prompt.
    $ sudo gluster volume stop volume1
    Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
    volume stop: volume1: success

    Stopping the volume interrupts client access but does not delete the volume definition or brick directories.

  9. Confirm that the volume reports Stopped.
    $ sudo gluster volume info volume1
    
    Volume Name: volume1
    Type: Replicate
    Status: Stopped
    ##### snipped #####
  10. Start the volume again when the maintenance window is complete.
    $ sudo gluster volume start volume1
    volume start: volume1: success
  11. Verify that the restarted volume has online bricks.
    $ sudo gluster volume status volume1
    Status of volume: volume1
    Gluster process                             TCP Port  RDMA Port  Online  Pid
    ------------------------------------------------------------------------------
    Brick node1:/srv/gluster/brick1/volume1      49152     0          Y       24410
    Brick node2:/srv/gluster/brick1/volume1      49153     0          Y       24288
    Self-heal Daemon on node1                    N/A       N/A        Y       24437
    Self-heal Daemon on node2                    N/A       N/A        Y       24309
    
    Task Status of Volume volume1
    ------------------------------------------------------------------------------
    There are no active volume tasks