]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: cleaner multi-mds startup with standbys
authorJohn Spray <john.spray@redhat.com>
Tue, 22 Nov 2016 13:58:58 +0000 (13:58 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 23 Nov 2016 14:17:44 +0000 (14:17 +0000)
The daemons will get assigned to roles in the
order they start otherwise.  The trick is
to let them all go into the FSMap first and
then increase max_mds.

Signed-off-by: John Spray <john.spray@redhat.com>
src/vstart.sh

index c8730b0b91ba8bf6f798db27a06349ffad56d71c..d09df84ed5b4c1e877a0c53ab017ce3814762eb3 100755 (executable)
@@ -709,10 +709,6 @@ if [ "$start_mds" -eq 1 -a "$CEPH_NUM_MDS" -gt 0 ]; then
         ceph_adm osd pool create "cephfs_data_${name}" 8
         ceph_adm osd pool create "cephfs_metadata_${name}" 8
         ceph_adm fs new "cephfs_${name}" "cephfs_metadata_${name}" "cephfs_data_${name}"
-        if [ "$CEPH_MAX_MDS" -gt 1 ]; then
-            ceph_adm fs set "cephfs_${name}" allow_multimds true --yes-i-really-mean-it
-            ceph_adm fs set "cephfs_${name}" max_mds "$CEPH_MAX_MDS"
-        fi
         fs=$(($fs + 1))
         [ $fs -eq $CEPH_NUM_FS ] && break
     done
@@ -761,6 +757,22 @@ EOF
     done
 fi
 
+# Don't set max_mds until all the daemons are started, otherwise
+# the intended standbys might end up in active roles.
+if [ "$CEPH_MAX_MDS" -gt 1 ]; then
+    sleep 5  # wait for daemons to make it into FSMap before increasing max_mds
+fi
+fs=0
+for name in a b c d e f g h i j k l m n o p
+do
+    if [ "$CEPH_MAX_MDS" -gt 1 ]; then
+        ceph_adm fs set "cephfs_${name}" allow_multimds true --yes-i-really-mean-it
+        ceph_adm fs set "cephfs_${name}" max_mds "$CEPH_MAX_MDS"
+    fi
+    fs=$(($fs + 1))
+    [ $fs -eq $CEPH_NUM_FS ] && break
+done
+
 if [ "$CEPH_NUM_MGR" -gt 0 ]; then
     mgr=0
     for name in x y z a b c d e f g h i j k l m n o p