]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: Add --standby_mds setting, for auto-creating standby-replays.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 25 Jan 2011 17:05:38 +0000 (09:05 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 25 Jan 2011 17:09:02 +0000 (09:09 -0800)
src/vstart.sh

index c90a2d528a10fadb8f97febd2509d5bedb7e02ca..09d9b2181df56a4c771fe35e034737fd48979b62 100755 (executable)
@@ -6,6 +6,7 @@
 
 extra_conf=""
 new=0
+standby=0
 debug=0
 start_all=1
 start_mon=0
@@ -28,6 +29,7 @@ monmap_fn=".ceph_monmap"
 usage="usage: $0 [option]... [mon] [mds] [osd]\n"
 usage=$usage"options:\n"
 usage=$usage"\t-d, --debug\n"
+usage=$usage"\t-s, --standby_mds: Generate standby-replay MDS for each active\n"
 usage=$usage"\t-n, --new\n"
 usage=$usage"\t--valgrind[_{osd,mds,mon}] 'toolname args...'\n"
 usage=$usage"\t-m ip:port\t\tspecify monitor address\n"
@@ -43,6 +45,9 @@ case $1 in
     -d | --debug )
            debug=1
            ;;
+    -s | --standby_mds)
+           standby=1
+           ;;
     -l | --localhost )
            localhost=1
            ;;
@@ -173,6 +178,11 @@ else
         mds log max segments = 2'
 fi
 
+if [ "$standby" -eq 1 ]; then
+    echo "standby got set"
+    CEPH_NUM_MDS=$(($CEPH_NUM_MDS * 2))
+fi
+
 if [ -n "$MON_ADDR" ]; then
        CMON_ARGS=" -m "$MON_ADDR
        COSD_ARGS=" -m "$MON_ADDR
@@ -376,6 +386,8 @@ fi
 # mds
 if [ "$start_mds" -eq 1 ]; then
     mds=0
+    last_mds_name=a
+    set_standby=0
     for name in a b c d e f g h i j k l m n o p
     do
        if [ "$new" -eq 1 ]; then
@@ -395,6 +407,18 @@ EOF
         keyring = $key_fn
 EOF
                fi
+               if [ "$standby" -eq 1 ]; then
+                   echo "noticing standby set"
+                   if [ "$set_standby" -eq 1 ]; then
+                       cat <<EOF >> $conf
+        mds standby replay = true
+        mds standby for name = $last_mds_nama
+EOF
+                       set_standby=0
+                   else
+                       set_standby=1
+                   fi
+               fi
            fi
            $SUDO $CEPH_BIN/cauthtool --create-keyring --gen-key --name=mds.$name \
                --cap mon 'allow *' \
@@ -407,6 +431,7 @@ EOF
        run 'mds' $CEPH_BIN/cmds -i $name $ARGS $CMDS_ARGS
        
        mds=$(($mds + 1))
+       last_mds_name=$name
        [ $mds -eq $CEPH_NUM_MDS ] && break
 
 #valgrind --tool=massif $CEPH_BIN/cmds $ARGS --mds_log_max_segments 2 --mds_thrash_fragments 0 --mds_thrash_exports 0 > m  #--debug_ms 20