Created
October 18, 2018 09:24
-
-
Save smola/020b4bde91195b9c530a1540ffdf852e to your computer and use it in GitHub Desktop.
Quick and dirty single-node GlusterFS setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
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
Please add step with command
service glusterd start
before line 22.