Skip to content

Instantly share code, notes, and snippets.

@anortef
Forked from smola/GLUSTER_SETUP.sh
Created May 21, 2019 05:10
Show Gist options
  • Save anortef/24757b76752145317c027ee806ddf9bd to your computer and use it in GitHub Desktop.
Save anortef/24757b76752145317c027ee806ddf9bd 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment