From: John Spray Date: Tue, 22 Nov 2016 13:58:58 +0000 (+0000) Subject: vstart: cleaner multi-mds startup with standbys X-Git-Tag: v11.1.0~38^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f45e972330f950d45d4bcb323d168a9beb0edf04;p=ceph.git vstart: cleaner multi-mds startup with standbys 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 --- diff --git a/src/vstart.sh b/src/vstart.sh index c8730b0b91ba8..d09df84ed5b4c 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -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