From b4f3a298f6ebbda40d6665110357c3e364af87d7 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 22 Mar 2017 13:04:06 +0800 Subject: [PATCH] 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 --- src/vstart.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index 0f22393aa5851..015db3ad04fd2 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 -- 2.39.5