CCONF="$BINDIR/cconf"
-conf=$ETCDIR"/cluster.conf"
-runtime_conf=$ETCDIR"/ceph.conf"
-
+conf=$ETCDIR"/ceph.conf"
hostname=`hostname | cut -d . -f 1`
-# make sure cluster.conf exists
-if [ ! -e $conf ]; then
- echo "$0: Cluster conf $conf not found"
- usage_exit
-fi
+verify_conf() {
+ # make sure ceph.conf exists
+ if [ ! -e $conf ]; then
+ echo "$0: ceph conf $conf not found"
+ usage_exit
+ fi
+}
check_host() {
shift
done
+verify_conf
+
# build mon_addr_arg with all mon addrs
n=0
mon_addr_arg=""
cmd="$cmd -c $conf"
else
if [[ ! $pushed_to =~ " $host " ]]; then
- scp $conf $host:/tmp/ceph.conf.$$
+ scp -q $conf $host:/tmp/ceph.conf.$$
pushed_to="$pushed_to $host "
fi
cmd="$cmd -c /tmp/ceph.conf.$$"
shift
done
+verify_conf
+
get_name_list "$@"
# create the monmap if we're doing mon0
# first, make a list of monitors
mons=`$CCONF -c $conf -l mon | egrep -v '^mon$' | sort`
args=""
- for mon in $mons; do
- get_conf addr "" "mon addr" mon0 mon global
+
+ type="mon"
+ for name in $mons; do
+ id=`echo $name | cut -c 4- | sed 's/\\.//'`
+ get_conf addr "" "mon addr"
args=$args" --add $addr"
done
# build monmap
monmap="/tmp/monmap.$$"
+ echo $BINDIR/monmaptool --create --clobber $args --print $monmap || exit 1
$BINDIR/monmaptool --create --clobber $args --print $monmap || exit 1
# build osdmap
check_host || continue
if [[ $ssh != "" ]] && [[ ! $pushed_to =~ " $host " ]]; then
- scp $osdmap $host:$osdmap
- scp $monmap $host:$monmap
+ scp -q $osdmap $host:$osdmap
+ scp -q $monmap $host:$monmap
pushed_to="$pushed_to $host "
fi