]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: add --msgr1, --msgr2, --msgr21 options
authorSage Weil <sage@redhat.com>
Fri, 30 Nov 2018 19:13:45 +0000 (13:13 -0600)
committerSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 21:31:32 +0000 (15:31 -0600)
..and clean up the monmap IP generation.

Signed-off-by: Sage Weil <sage@redhat.com>
src/vstart.sh

index a497ad3c32625cf6042fa23fd116037793bee787..a60b19972a40184f18fd93ce04f5e7f3b20fd842 100755 (executable)
@@ -155,6 +155,8 @@ keyring_fn="$CEPH_CONF_PATH/keyring"
 osdmap_fn="/tmp/ceph_osdmap.$$"
 monmap_fn="/tmp/ceph_monmap.$$"
 
+msgr="21"
+
 usage="usage: $0 [option]... \nex: MON=3 OSD=1 MDS=1 MGR=1 RGW=1 $0 -n -d\n"
 usage=$usage"options:\n"
 usage=$usage"\t-d, --debug\n"
@@ -188,6 +190,9 @@ usage=$usage"\t--nolockdep disable lockdep\n"
 usage=$usage"\t--multimds <count> allow multimds with maximum active count\n"
 usage=$usage"\t--without-dashboard: do not run using mgr dashboard\n"
 usage=$usage"\t--bluestore-spdk <vendor>:<device>: enable SPDK and specify the PCI-ID of the NVME device\n"
+usage=$usage"\t--msgr1: use msgr1 only\n"
+usage=$usage"\t--msgr2: use msgr2 only\n"
+usage=$usage"\t--msgr21: use msgr2 and msgr1\n"
 
 usage_exit() {
        printf "$usage"
@@ -222,6 +227,15 @@ case $1 in
     --short )
            short=1
            ;;
+    --msgr1 )
+       msgr="1"
+       ;;
+    --msgr2 )
+       msgr="2"
+       ;;
+    --msgr21 )
+       msgr="21"
+       ;;
     --valgrind )
            [ -z "$2" ] && usage_exit
            valgrind=$2
@@ -464,6 +478,22 @@ prepare_conf() {
       mgr_modules="dashboard $mgr_modules"
     fi
 
+    local msgr_conf=''
+    if [ $msgr -eq 21 ]; then
+       msgr_conf="ms bind msgr2 = true
+ms bind msgr1 = true
+";
+    fi
+    if [ $msgr -eq 2 ]; then
+       msgr_conf="ms bind msgr2 = true
+";
+    fi
+    if [ $msgr -eq 1 ]; then
+       msgr_conf="ms bind msgr2 = false
+ms bind msgr1 = true
+";
+    fi
+
     wconf <<EOF
 ; generated by vstart.sh on `date`
 [$VSTART_SEC]
@@ -487,6 +517,7 @@ prepare_conf() {
         enable experimental unrecoverable data corrupting features = *
        osd_crush_chooseleaf_type = 0
        debug asok assert abort = true
+$msgr_conf
 $extra_conf
 EOF
        if [ "$lockdep" -eq 1 ] ; then
@@ -653,14 +684,23 @@ start_mon() {
                local count=0
                for f in $MONS
                do
-                       str="$str --add $f v2:$IP:$(($CEPH_PORT+$count))"
-                       wconf <<EOF
+                   if [ $msgr -eq 1 ]; then
+                       A="v1:$IP:$(($CEPH_PORT+$count+1))"
+                   fi
+                   if [ $msgr -eq 2 ]; then
+                       A="v2:$IP:$(($CEPH_PORT+$count+1))"
+                   fi
+                   if [ $msgr -eq 21 ]; then
+                       A="v2:$IP:$(($CEPH_PORT+$count)),v1:$IP:$(($CEPH_PORT+$count+1))"
+                   fi
+                   str="$str --addv $f $A"
+                   wconf <<EOF
 [mon.$f]
         host = $HOSTNAME
         mon data = $CEPH_DEV_DIR/mon.$f
-        mon addr = v2:$IP:$(($CEPH_PORT+$count))
+        mon addr = $A
 EOF
-                       count=$(($count + 1))
+                   count=$(($count + 2))
                done
                prun "$CEPH_BIN/monmaptool" --create --clobber $str --print "$monmap_fn"