Created
May 6, 2013 09:16
-
-
Save agranig/5524168 to your computer and use it in GitHub Desktop.
Bootstrap glusterfs on sp2
This file contains 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
#!/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