ceph/src/vstartnew.sh

51 lines
1.4 KiB
Bash
Raw Normal View History

2008-04-18 17:05:55 +00:00
#!/bin/sh
./stop.sh
rm core*
test -d out || mkdir out
rm out/*
# figure machine's ip
HOSTNAME=`hostname`
IP=`host $HOSTNAME | grep $HOSTNAME | cut -d ' ' -f 4`
2008-04-18 17:05:55 +00:00
[ "$CEPH_BIN" == "" ] && CEPH_BIN=.
echo hostname $HOSTNAME
echo "ip $IP"
if [ `echo $IP | grep '^127\\.'` ]
then
echo
echo "WARNING: hostname resolves to loopback; remote hosts will not be able to"
echo " connect. either adjust /etc/hosts, or edit this script to use your"
echo " machine's real IP."
echo
fi
# build a fresh fs monmap, mon fs
$CEPH_BIN/monmaptool --create --clobber --add $IP:12345 --print .ceph_monmap
$CEPH_BIN/mkmonfs --clobber mondata/mon0 --mon 0 --monmap .ceph_monmap
# shared args
ARGS="-d"
2008-04-18 17:05:55 +00:00
# start monitor
$CEPH_BIN/cmon $ARGS mondata/mon0 --debug_mon 20 --debug_ms 1
2008-04-18 17:05:55 +00:00
# build and inject an initial osd map
$CEPH_BIN/osdmaptool --clobber --createsimple .ceph_monmap 8 --print .ceph_osdmap --pgbits 2
2008-04-18 17:05:55 +00:00
$CEPH_BIN/cmonctl osd setmap -i .ceph_osdmap
for osd in 0 1 2 3 #4 5 6 7
2008-04-18 17:05:55 +00:00
do
$CEPH_BIN/cosd --mkfs_for_osd $osd dev/osd$osd # initialize empty object store
2008-05-20 04:28:42 +00:00
#valgrind --tool=massif $CEPH_BIN/cosd dev/osd$osd --debug_ms 1 --debug_osd 20 --debug_fakestore 10 1>out/o$osd & #--debug_osd 40
$CEPH_BIN/cosd dev/osd$osd -d --debug_ms 1 --debug_osd 20 --debug_fakestore 10
2008-04-18 17:05:55 +00:00
done
# mds
2008-05-12 17:31:29 +00:00
$CEPH_BIN/cmds $ARGS --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 #--debug_ms 20
2008-04-18 17:05:55 +00:00
echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output."