From: Kefu Chai Date: Wed, 22 Mar 2017 05:04:06 +0000 (+0800) Subject: vstart.sh: do not init fsmap if "$new == 0" X-Git-Tag: v12.0.2~325^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13974%2Fhead;p=ceph.git vstart.sh: do not init fsmap if "$new == 0" we cannot create a new cephfs using a non-empty pool without '--force' option now, so the "ceph fs new" command fails with "vstart.sh -k". Signed-off-by: Kefu Chai --- diff --git a/src/vstart.sh b/src/vstart.sh index 0f22393aa58..015db3ad04f 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -604,20 +604,22 @@ EOF } start_mds() { - if [ "$CEPH_NUM_FS" -gt "0" ] ; then - if [ "$CEPH_NUM_FS" -gt "1" ] ; then - ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it - fi + if [ $new -eq 1 ]; then + if [ "$CEPH_NUM_FS" -gt "0" ] ; then + if [ "$CEPH_NUM_FS" -gt "1" ] ; then + ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it + fi - local fs=0 - for name in a b c d e f g h i j k l m n o p - do - 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}" - fs=$(($fs + 1)) - [ $fs -eq $CEPH_NUM_FS ] && break - done + local fs=0 + for name in a b c d e f g h i j k l m n o p + do + 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}" + fs=$(($fs + 1)) + [ $fs -eq $CEPH_NUM_FS ] && break + done + fi fi local mds=0