Skip to content

Instantly share code, notes, and snippets.

@agranig
Created May 6, 2013 09:16
Show Gist options
  • Save agranig/5524168 to your computer and use it in GitHub Desktop.
Save agranig/5524168 to your computer and use it in GitHub Desktop.
Bootstrap glusterfs on sp2
#!/bin/sh -ex
DIR1=/var/lib/glusterfs/export
DIR2=/tmp/export-tmp
VOL=ngcp
rm -rf $DIR1 $DIR2
mkdir -p $DIR1 $DIR2
umount /mnt/glusterfs 1>/dev/null 2>/dev/null || true
gluster peer probe sp1
gluster volume replace-brick $VOL sp1:$DIR2 sp2:$DIR1 start
echo "waiting for migration to complete"
STAT=1
while [ "$STAT" -ne "0" ]; do
sleep 5
gluster volume replace-brick $VOL sp1:$DIR2 sp2:$DIR1 status | \
grep 'Migration complete' 1>/dev/null 2>/dev/null
STAT=$?
done
gluster volume replace-brick $VOL sp1:$DIR2 sp2:$DIR1 commit
gluster volume info $VOL
mount -t glusterfs sp2:$VOL /mnt/glusterfs/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment