# Out of tree build, learn source location from CMakeCache.txt
CEPH_ROOT=`grep ceph_SOURCE_DIR CMakeCache.txt | cut -d "=" -f 2`
CEPH_BUILD_DIR=`pwd`
+ [ -z "$MGR_PYTHON_PATH" ] && MGR_PYTHON_PATH=$CEPH_ROOT/src/pybind/mgr
fi
# use CEPH_BUILD_ROOT to vstart from a 'make install'
[ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON="$MON"
[ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD="$OSD"
[ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS="$MDS"
+[ -z "$CEPH_NUM_MGR" ] && CEPH_NUM_MGR="$MGR"
[ -z "$CEPH_NUM_FS" ] && CEPH_NUM_FS="$FS"
[ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW="$RGW"
[ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON=3
[ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD=3
[ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS=3
+[ -z "$CEPH_NUM_MGR" ] && CEPH_NUM_MGR=0
[ -z "$CEPH_NUM_FS" ] && CEPH_NUM_FS=1
[ -z "$CEPH_MAX_MDS" ] && CEPH_MAX_MDS=1
[ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW=1
CEPH_NUM_OSD="$OSD"
MDS=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC num_mds 2>/dev/null` && \
CEPH_NUM_MDS="$MDS"
+ MGR=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC num_mgr 2>/dev/null` && \
+ CEPH_NUM_MGR="$MGR"
RGW=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC num_rgw 2>/dev/null` && \
CEPH_NUM_RGW="$RGW"
else
debug mds = 20
debug auth = 20
debug monc = 20
+ debug mgrc = 20
mds debug scatterstat = true
mds verify scatter = true
mds log max segments = 2'
+ CMGRDEBUG='
+ debug ms = 1
+ debug monc = 20
+ debug mgr = 20'
fi
if [ -n "$MON_ADDR" ]; then
num mon = $CEPH_NUM_MON
num osd = $CEPH_NUM_OSD
num mds = $CEPH_NUM_MDS
+ num mgr = $CEPH_NUM_MGR
num rgw = $CEPH_NUM_RGW
[global]
mds root ino uid = `id -u`
mds root ino gid = `id -g`
$extra_conf
+[mgr]
+ mgr data = $CEPH_DEV_DIR/mgr.\$id
+ mgr module path = $MGR_PYTHON_PATH
+$DAEMONOPTS
+$CMGRDEBUG
+$extra_conf
[osd]
$DAEMONOPTS
osd_check_max_object_name_len_on_startup = false
key_fn=$CEPH_DEV_DIR/osd$osd/keyring
echo adding osd$osd key to auth repository
- ceph_adm -i "$key_fn" auth add osd.$osd osd "allow *" mon "allow profile osd"
+ ceph_adm -i "$key_fn" auth add osd.$osd osd "allow *" mon "allow profile osd" mgr "allow"
fi
echo start osd$osd
run 'osd' $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS $COSD_ARGS
EOF
fi
prun $SUDO "$CEPH_BIN/ceph-authtool" --create-keyring --gen-key --name="mds.$name" "$key_fn"
- ceph_adm -i "$key_fn" auth add "mds.$name" mon 'allow profile mds' osd 'allow *' mds 'allow'
+ ceph_adm -i "$key_fn" auth add "mds.$name" mon 'allow profile mds' osd 'allow *' mds 'allow' mgr 'allow'
if [ "$standby" -eq 1 ]; then
prun $SUDO "$CEPH_BIN/ceph-authtool" --create-keyring --gen-key --name="mds.${name}s" \
"$CEPH_DEV_DIR/mds.${name}s/keyring"
ceph_adm -i "$CEPH_DEV_DIR/mds.${name}s/keyring" auth add "mds.${name}s" \
- mon 'allow *' osd 'allow *' mds 'allow'
+ mon 'allow *' osd 'allow *' mds 'allow' mgr 'allow'
fi
fi
done
fi
+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
+ do
+ if [ "$new" -eq 1 ]; then
+ mkdir -p $CEPH_DEV_DIR/mgr.$name
+ key_fn=$CEPH_DEV_DIR/mgr.$name/keyring
+ $SUDO $CEPH_BIN/ceph-authtool --create-keyring --gen-key --name=mgr.$name $key_fn
+ ceph_adm -i $key_fn auth add mgr.$name mon 'allow *'
+ fi
+
+ cat <<EOF >> $conf_fn
+[mgr.$name]
+
+EOF
+
+ echo "Starting mgr.${name}"
+ run 'mgr' $CEPH_BIN/ceph-mgr -i $name
+
+ mgr=$(($mgr + 1))
+ [ $mgr -eq $CEPH_NUM_MGR ] && break
+ done
+fi
+
if [ "$ec" -eq 1 ]; then
ceph_adm <<EOF
osd erasure-code-profile set ec-profile m=2 k=2