Skip to content

Instantly share code, notes, and snippets.

@smola
Created October 18, 2018 09:24
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save smola/020b4bde91195b9c530a1540ffdf852e to your computer and use it in GitHub Desktop.
Save smola/020b4bde91195b9c530a1540ffdf852e to your computer and use it in GitHub Desktop.
Quick and dirty single-node GlusterFS setup
#
# Instructions for quick gluster server (1 node) setup with a volume on LVM.
# No replication, just using localhost.
#
# See https://docs.gluster.org/en/latest/Administrator%20Guide/Brick%20Naming%20Conventions/
#
# Install GlusterFS
add-apt-repository ppa:gluster/glusterfs-4.0
apt-get install glusterfs-server
# Create an LVM volume, format with XFS
lvcreate -L 10G -n gluster lvm-vg-main
apt-get install xfsprogs
mkfs.xfs /dev/lvm-vg-main/gluster
# Create directory for brick and mount LVM volume
mkdir -p /data/glusterfs/myvol1/brick1
mount /dev/lvm-vg-main/gluster /data/glusterfs/myvol1/brick1
# Create volume in gluster
gluster volume create myvol1 $HOSTNAME:/data/glusterfs/myvol1/brick1/brick
gluster volume start myvol1
# Mount!
mkdir -p /mnt/glusterfs
mount -t glusterfs $HOSTNAME:myvol1 /mnt/glusterfs
@stepanovmm1992
Copy link

Please add step with command service glusterd start before line 22.

@avoidik
Copy link

avoidik commented Apr 19, 2022

I'd also add this line to `/etc/fstab' file

echo "$HOSTNAME:myvol1 /mnt/glusterfs glusterfs defaults,_netdev 0 0" >> /etc/fstab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment