From 81fa2ca34fb4628ca76a6ccec506324a6da596de Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Thu, 24 Mar 2016 17:36:42 +0800 Subject: [PATCH] vstart: make -k with optional mon_num. 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 --- src/vstart.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vstart.sh b/src/vstart.sh index 151ca1b2877e8..6770e4a09dea5 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -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 < $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 -- 2.39.5