Raspberry Pi – how to create a high available redundant replicated storage with Glusterfs

Glusterfs – building a Raspberry Pi storage cluster to run a ‚big data‘ environment at home

 

 

# apt-get update && apt-get upgrade -y
# apt-get install xfsprogs
# mkfs.xfs -f -i size=512 /dev/sda1

# mkdir -p /data/brick1
# vi /etc/fstab
    /dev/sda1 /data/brick1 xfs defaults 1 2
# mount -a
# apt-get install rpcbind
# apt-get install glusterfs-server
# systemctl start glusterd.service
# systemctl enable glusterd.service
# systemctl restart glusterd.service
# glusterfsd –version
# gluster peer probe rpi-iot-jsho-gluster-01
# gluster peer probe rpi-iot-jsho-gluster-02
# gluster peer status
root@rpi-iot-jsho-gluster-01:~# mkdir /data/brick1/gv0
root@rpi-iot-jsho-gluster-02:~#mkdir /data/brick1/gv0
root@rpi-iot-jsho-gluster-01:~# gluster volume create gv0 replica 2 rpi-iot-jsho-gluster-01:/data/brick1/gv0 rpi-iot-jsho-gluster-02:/data/brick1/gv0
root@rpi-iot-jsho-gluster-01:~#  gluster volume start gv0
root@rpi-iot-jsho-gluster-01:~# gluster volume set testvol auth.allow 192.168.1.3
root@rpi-iot-jsho-gluster-01:~# gluster volume info
root@rpi-iot-jsho-gluster-01:~# gluster pool list

root@rpi-iot-jsho-gluster-01:~# mkdir -p /mnt/gv0
root@rpi-iot-jsho-gluster-01:~# mount -t glusterfs rpi-iot-jsho-gluster-01:/gv0 /mnt/gv0
root@rpi-iot-jsho-gluster-02:~# mkdir -p /mnt/gv0
root@rpi-iot-jsho-gluster-02:~# mount -t glusterfs rpi-iot-jsho-gluster-02:/gv0 /mnt/gv0
root@rpi-iot-jsho-gluster-01:~# touch /mnt/gv0/testfile{1..5}
root@rpi-iot-jsho-gluster-02:~# touch /mnt/gv0/testfile{6..10}
root@rpi-iot-jsho-gluster-01:~# ls /data/brick1/gv0/
file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
root@rpi-iot-jsho-gluster-02:~# ls /data/brick1/gv0/
file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
root@rpi-iot-jsho-gluster-01:~# vi /etc/fstab
rpi-iot-jsho-gluster-01:/gv0 /mnt/gv0 glusterfs defaults,_netdev 0 0
root@rpi-iot-jsho-gluster-02:~# vi /etc/fstab
rpi-iot-jsho-gluster-02:/gv0 /mnt/gv0 glusterfs defaults,_netdev 0 0
root@rpi-iot-jsho-gluster-01:~# df -h /mnt/gv0

root@rpi-iot-jsho-gluster-01:~# gluster volume profile gv0 start
root@rpi-iot-jsho-gluster-01:~# gluster volume profile gv0 info

root@rpi-iot-jsho-gluster-01:~# gluster volume profile gv0 stop
root@rpi-iot-jsho-gluster-01:~# netstat -tap | grep glusterfsd

 

Einrichten eines GlusterFS Client

# apt-get install glusterfs-client
# mkdir -p /mnt/gv0
# mount.glusterfs rpi-iot-jsho-gluster-01:/gv0 /mnt/gv0

Leave a Reply

You must be logged in to post a comment.