Chapter 12. Using the Gluster Command Line Interface

The Gluster command line interface (CLI) simplifies configuration and management of the storage environment. The Gluster CLI is similar to the LVM (Logical Volume Manager) CLI or the ZFS CLI, but operates across multiple storage servers. The Gluster CLI can be used when volumes are mounted (active) and not mounted (inactive). Red Hat Gluster Storage automatically synchronizes volume configuration information across all servers.
Use the Gluster CLI to create new volumes, start and stop existing volumes, add bricks to volumes, remove bricks from volumes, and change translator settings. Additionally, the Gluster CLI commands can create automation scripts and use the commands as an API to allow integration with third-party applications.


Appending --mode=script to any CLI command ensures that the command executes without confirmation prompts.
Running the Gluster CLI

Run the Gluster CLI on any Red Hat Gluster Storage Server by either invoking the commands or running the Gluster CLI in interactive mode. The gluster command can be remotely used via SSH.

Run commands directly as follows, after replacing COMMAND with the required command:
# gluster peer COMMAND
The following is an example using the status command:
# gluster peer status
Gluster CLI Interactive Mode

Alternatively, run the Gluster CLI in interactive mode using the following command:

# gluster
If successful, the prompt changes to the following:
When the prompt appears, execute gluster commands from the CLI prompt as follows:
gluster> COMMAND
As an example, replace the COMMAND with a command such as status to view the status of the peer server:
  1. Start Gluster CLI's interactive mode:
    # gluster
  2. Request the peer server status:
    gluster> status
  3. The peer server status displays.
The following is another example, replacing the COMMAND with a command such as help to view the gluster help options.
  1. Start Gluster CLI's interactive mode:
    # gluster
  2. Request the help options:
    gluster> help
  3. A list of gluster commands and options displays.