]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: make -k with optional mon_num. 8251/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 24 Mar 2016 09:36:42 +0000 (17:36 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 24 Mar 2016 09:40:42 +0000 (17:40 +0800)
Default mon_num=3, if we change this and using -k to create a new
cluster. It don't work. So we must record the old mon_num.
The same for osd_num/mds_num/rgw_num.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/vstart.sh

index 151ca1b2877e8ca37ea1114a501b376c5766ab67..6770e4a09dea536d9f56e05dd95b445d4780f4ed 100755 (executable)
@@ -275,6 +275,13 @@ esac
 shift
 done
 
+if [ "$overwrite_conf" -eq 0 ]; then
+  CEPH_NUM_MON=`awk -F= '/CEPH_NUM_MON/{print $2}' $conf_fn`
+  CEPH_NUM_OSD=`awk -F= '/CEPH_NUM_OSD/{print $2}' $conf_fn`
+  CEPH_NUM_MDS=`awk -F= '/CEPH_NUM_MDS/{print $2}' $conf_fn`
+  CEPH_NUM_RGW=`awk -F= '/CEPH_NUM_RGW/{print $2}' $conf_fn`
+fi
+
 if [ "$start_all" -eq 1 ]; then
        start_mon=1
        start_mds=1
@@ -436,6 +443,10 @@ if [ "$start_mon" -eq 1 ]; then
                if [ $overwrite_conf -eq 1 ]; then
                        cat <<EOF > $conf_fn
 ; generated by vstart.sh on `date`
+; CEPH_NUM_MON=$CEPH_NUM_MON
+; CEPH_NUM_OSD=$CEPH_NUM_OSD
+; CEPH_NUM_MDS=$CEPH_NUM_MDS
+; CEPH_NUM_RGW=$CEPH_NUM_RGW
 [global]
         fsid = $(uuidgen)
         osd pg bits = 3