]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkfs and startup scripts
authorSage Weil <sage@newdream.net>
Wed, 19 Mar 2008 17:49:37 +0000 (10:49 -0700)
committerSage Weil <sage@newdream.net>
Wed, 19 Mar 2008 18:04:23 +0000 (11:04 -0700)
src/boot.sh [new file with mode: 0644]
src/mkfs.sh [new file with mode: 0755]

diff --git a/src/boot.sh b/src/boot.sh
new file mode 100644 (file)
index 0000000..5365de5
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+./stop.sh
+rm core*
+
+test -d out || mkdir out
+rm out/*
+
+# figure machine's ip
+HOSTNAME=`hostname`
+IP=`host $HOSTNAME | cut -d ' ' -f 4`
+[ "$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
+
+# shared args
+ARGS="-d --bind $IP -o out --debug_ms 1"
+
+# monitor
+$CEPH_BIN/cmon $ARGS mondata/mon0 --debug_mon 20 --debug_ms 1
+
+# osds
+for osd in 0 1 2 3 
+do
+ $CEPH_BIN/cosd --mkfs_for_osd $osd dev/osd$osd  # initialize empty object store
+ $CEPH_BIN/cosd $ARGS dev/osd$osd --debug_osd 40
+done
+
+# mds
+$CEPH_BIN/cmds $ARGS --debug_mds 10
+
+echo "started.  stop.sh to stop.  see out/* (e.g. 'tail -f out/????') for debug output."
+
diff --git a/src/mkfs.sh b/src/mkfs.sh
new file mode 100755 (executable)
index 0000000..ce71af8
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# figure machine's ip
+HOSTNAME=`hostname`
+IP=`host $HOSTNAME | cut -d ' ' -f 4`
+[ "$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 --bind $IP -o out --debug_ms 1"
+
+# start monitor
+$CEPH_BIN/cmon $ARGS mondata/mon0 --debug_mon 20 --debug_ms 1
+
+# build and inject an initial osd map
+$CEPH_BIN/osdmaptool --clobber --createsimple .ceph_monmap 4 --print .ceph_osdmap
+$CEPH_BIN/cmonctl osd setmap -i .ceph_osdmap
+
+# stop monitor
+killall cmon
+#$CEPH_BIN/cmonctl stop
+
+echo "mkfs done."
+