Table of Contents

Glusterfs

General Information

Description: GlusterFS is a scalable network filesystem. Uses common off the shelf hardware. It is free and open source.

Checklist


Servers and Client

These examples all assume that there are:


Data Directory Config

Some important recommendations

Servers: Data Dir Config Steps

  1. Install XFS utilities
    1. yum install xfsprogs
  2. Create file system with GlusterFS recommended fileystem and inode size
    1. mkfs.xfs -i size=512 /dev/mapper/vgdata-lvdata1
  3. Create directory structure that data will be stored in
    1. mkdir -p /data/glusterfs/myvol/brick1
  4. /etc/fstab entry for mount point
    1. ## XFS Mount Used for GlusterFS
      /dev/mapper/vgdata-lvdata1 /data/glusterfs/myvol/brick1 xfs  defaults 1 2
  5. Mount data directory
    1. mount -a
  6. Create top level “brick” directory - All data will go under here
    1. mkdir /data/glusterfs/myvol/brick1/brick

Installation

Installation steps taken for the glusterfs servers and clients.

Server Install

On the Gluster Servers:

  1. Add the gluster repo
    1. wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
  2. Install glusterfs-server
    1. yum install glusterfs-server
  1. Start gluster daemon
    1. service glusterd start
  2. Ensure gluster daemon is enabled on startup
    1. chkconfig glusterd on

Client Install

On the Gluster Clients:

  1. Install Gluster repo
    1. wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
  2. Install glusterfs and fuse
    1. yum install glusterfs glusterfs-fuse

Configuration

Configuration steps to setup gluster servers and clients.

Server Config

  1. Configure Trusted Pool
    1. From server1
      • gluster peer probe server2
      • Note: Once a trusted pool has been created, only existing pool members can probe new servers.
      • New servers cannot probe a pool member.
  2. Create a GlusterFS Volume ⇒ How the volume is created depicts whether data is distributed, striped, replicated, or a combination.
    • Note: A volume cannot be created at a mount point; it must be a subdirectory within the mount point
    • Distributed(default): A normal “gluster volume create” with no arguments creates a distributed volume. This has no redundancy; files will round robin between bricks that are in the volume. The following alternates between server1 and server2 storage.
      • gluster volume create myvol server1:/data/glusterfs/myvol/brick1/brick server2:/data/glusterfs/myvol/brick1/brick
    • Replicated: A copy of the data is kept on each brick. (Amount determined by the replica number, but should equal # of bricks) The following keeps a copy on server1 and server2.
      • gluster volume create myvol replica 2 transport tcp server1:/data/glusterfs/myvol/brick1/brick server2:/data/glusterfs/myvol/brick1/brick
    • Distributed Replicated: Files distributed across replicated sets of bricks. (# bricks should be multiple of # of replicas and adjacent servers are the replicated sets) The following round robins between the “replicated sets” server1/server2 and server3/server4. Data will exist on two servers at all times.
      • gluster volume create myvol replica 2 transport tcp server1:/data/glusterfs/myvol/brick1/brick server2:/data/glusterfs/myvol/brick1/brick server3:/data/glusterfs/myvol/brick1/brick server4:/data/glusterfs/myvol/brick1/brick
    • More types:
  3. Start the Gluster volume to make it usable by clients
    1. gluster volume start myvol

Client Config

Operation

Server Ops

Viewing Status

Storage Pools

Volumes

Balance Data

Data can be re-balanced live and should be done after adding/removing nodes to the volume. There are two types of rebalance options:

Security