]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh
authorSage Weil <sage@newdream.net>
Wed, 5 Nov 2008 22:54:51 +0000 (14:54 -0800)
committerSage Weil <sage@newdream.net>
Wed, 5 Nov 2008 22:55:08 +0000 (14:55 -0800)
src/TODO
src/dstart.sh
src/vstart.sh [new file with mode: 0755]
src/vstartnew.sh [deleted file]

index 36b80c3147226403faf58824cab44db3b4abc7f6..a7e0c484fd2962300b76ba322f0bd3284f390d0e 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -1,6 +1,6 @@
 v0.5
 - debug restart, cosd reformat, etc.
-- finish btrfs ioctl interface
+/- finish btrfs ioctl interface
 - efficient snap recovery
 - throttle osd recovery
 - forced unmount?
index 277246a8b9e1536bbfe6f1d3eb5ee04c5a1da228..2f7e3e68c2f2f48e71e18781fdfdc6a25a00f784 100755 (executable)
@@ -39,7 +39,6 @@ if [ $new -eq 1 ]; then
     # figure machine's ip
     HOSTNAME=`hostname`
     IP=`host $HOSTNAME | grep $HOSTNAME | cut -d ' ' -f 4`
-    [ "$CEPH_BIN" == "" ] && CEPH_BIN=.
 
     echo hostname $HOSTNAME
     echo "ip $IP"
diff --git a/src/vstart.sh b/src/vstart.sh
new file mode 100755 (executable)
index 0000000..94e79d2
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+[ "$CEPH_NUM_MON" == "" ] && CEPH_NUM_MON=3
+[ "$CEPH_NUM_OSD" == "" ] && CEPH_NUM_OSD=4
+[ "$CEPH_NUM_MDS" == "" ] && CEPH_NUM_MDS=1
+
+let new=0
+let debug=0
+norestart=""
+
+while [ $# -ge 1 ]; do
+        case $1 in
+                -d | --debug )
+                debug=1
+               ;;
+                --new | -n )
+                new=1
+               ;;
+               --norestart )
+               norestart="--norestart"
+        esac
+        shift
+done
+
+ARGS="-f"
+
+if [ $debug -eq 0 ]; then
+       CMON_ARGS="--debug_mon 10 --debug_ms 1"
+       COSD_ARGS=""
+       CMDS_ARGS=""
+else
+       echo "** going verbose **"
+       CMON_ARGS="--lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
+       COSD_ARGS="--lockdep 1 --debug_osd 20 --debug_journal 20 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
+       CMDS_ARGS="--lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 0"
+fi
+
+
+# lockdep everywhere?
+export CEPH_ARGS="--lockdep 1"
+
+
+# sudo if btrfs
+test -d dev/osd0 && SUDO="sudo"
+
+$SUDO ./stop.sh
+$SUDO rm -f core*
+
+test -d out || mkdir out
+$SUDO rm -f out/*
+test -d gmon && $SUDO rm -rf gmon/*
+
+
+# figure machine's ip
+HOSTNAME=`hostname`
+IP=`host $HOSTNAME | grep $HOSTNAME | cut -d ' ' -f 4`
+[ "$CEPH_PORT" == "" ] && CEPH_PORT=12345
+echo hostname $HOSTNAME
+echo "ip $IP"
+
+if [ $new -eq 1 ]; then
+    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
+    # ./monmaptool --create --clobber --print .ceph_monmap
+    str="./monmaptool --create --clobber"
+    for f in `seq 0 $((CEPH_NUM_MON-1))`
+    do
+       str=$str" --add $IP:$(($CEPH_PORT+$f))"
+    done
+    str=$str" --print .ceph_monmap"
+    echo $str
+    $str
+    
+    for f in `seq 0 $((CEPH_NUM_MON-1))`
+    do
+       ./mkmonfs --clobber mondata/mon$f --mon $f --monmap .ceph_monmap
+    done
+fi
+
+# start monitors
+for f in `seq 0 $((CEPH_NUM_MON-1))`
+do
+    ./cmon $ARGS -d $CMON_ARGS mondata/mon$f
+done
+
+
+if [ $new -eq 1 ]; then
+    # build and inject an initial osd map
+    ./osdmaptool --clobber --createsimple .ceph_monmap 4 .ceph_osdmap # --pgbits 2
+    ./cmonctl osd setmap -i .ceph_osdmap
+fi
+
+for osd in `seq 0 $((CEPH_NUM_OSD-1))`
+do
+    if [ $new -eq 1 ]; then
+       echo mkfs osd$osd
+       $SUDO ./cosd --mkfs_for_osd $osd dev/osd$osd # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
+    fi
+    echo start osd$osd
+    ./crun $norestart $SUDO ./cosd -m $IP:$CEPH_PORT dev/osd$osd $ARGS $COSD_ARGS &
+# echo valgrind --leak-check=full --show-reachable=yes ./cosd dev/osd$osd --debug_ms 1 --debug_osd 20 --debug_filestore 10 --debug_ebofs 20 #1>out/o$osd #& #--debug_osd 40
+done
+
+# mds
+for mds in `seq 0 $((CEPH_NUM_MDS-1))`
+do
+    ./crun $norestart ./cmds $ARGS $CMDS_ARGS &
+
+#valgrind --tool=massif ./cmds $ARGS --mds_log_max_segments 2 --mds_thrash_fragments 0 --mds_thrash_exports 0 > m  #--debug_ms 20
+#./cmds -d $ARGS --mds_thrash_fragments 0 --mds_thrash_exports 0 #--debug_ms 20
+#./cmonctl mds set_max_mds 2
+done
+
+echo "started.  stop.sh to stop.  see out/* (e.g. 'tail -f out/????') for debug output."
+
diff --git a/src/vstartnew.sh b/src/vstartnew.sh
deleted file mode 100755 (executable)
index 6b16609..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/bash
-
-[ "$CEPH_NUM_MON" == "" ] && CEPH_NUM_MON=3
-[ "$CEPH_NUM_OSD" == "" ] && CEPH_NUM_OSD=4
-[ "$CEPH_NUM_MDS" == "" ] && CEPH_NUM_MDS=1
-
-let debug=0
-norestart=""
-
-while [ $# -ge 1 ]; do
-        case $1 in
-                -d | --debug )
-                debug=1
-               ;;
-               -n )
-               norestart="--norestart"
-        esac
-        shift
-done
-
-ARGS="-f"
-
-if [ $debug -eq 0 ]; then
-       CMON_ARGS="--debug_mon 10 --debug_ms 1"
-       COSD_ARGS=""
-       CMDS_ARGS=""
-else
-       echo "** going verbose **"
-       CMON_ARGS="--lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
-       COSD_ARGS="--lockdep 1 --debug_osd 20 --debug_journal 20 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
-       CMDS_ARGS="--lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 0"
-fi
-
-
-# lockdep everywhere?
-export CEPH_ARGS="--lockdep 1"
-
-
-# sudo if btrfs
-test -d dev/osd0 && SUDO="sudo"
-
-$SUDO ./stop.sh
-$SUDO rm -f core*
-
-test -d out || mkdir out
-$SUDO rm -f out/*
-test -d gmon && $SUDO rm -rf gmon/*
-
-# figure machine's ip
-HOSTNAME=`hostname`
-IP=`host $HOSTNAME | grep $HOSTNAME | cut -d ' ' -f 4`
-[ "$CEPH_BIN" == "" ] && CEPH_BIN=.
-[ "$CEPH_PORT" == "" ] && CEPH_PORT=12345
-
-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 --print .ceph_monmap
-str="$CEPH_BIN/monmaptool --create --clobber"
-for f in `seq 0 $((CEPH_NUM_MON-1))`
-do
- str=$str" --add $IP:$(($CEPH_PORT+$f))"
-done
-str=$str" --print .ceph_monmap"
-echo $str
-$str
-
-for f in `seq 0 $((CEPH_NUM_MON-1))`
-do
-#  $CEPH_BIN/monmaptool --add $IP:$(($CEPH_PORT+$f)) --print .ceph_monmap
- $CEPH_BIN/mkmonfs --clobber mondata/mon$f --mon $f --monmap .ceph_monmap
- $CEPH_BIN/cmon $ARGS -d $CMON_ARGS mondata/mon$f
-done
-
-# build and inject an initial osd map
-$CEPH_BIN/osdmaptool --clobber --createsimple .ceph_monmap 4 .ceph_osdmap # --pgbits 2
-$CEPH_BIN/cmonctl osd setmap -i .ceph_osdmap
-
-for osd in `seq 0 $((CEPH_NUM_OSD-1))`
-do
- echo mkfs osd$osd
- $SUDO $CEPH_BIN/cosd --mkfs_for_osd $osd dev/osd$osd # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
- echo start osd$osd
- $CEPH_BIN/crun $norestart $SUDO $CEPH_BIN/cosd -m $IP:$CEPH_PORT dev/osd$osd $ARGS $COSD_ARGS &
-# echo valgrind --leak-check=full --show-reachable=yes $CEPH_BIN/cosd dev/osd$osd --debug_ms 1 --debug_osd 20 --debug_filestore 10 --debug_ebofs 20 #1>out/o$osd #& #--debug_osd 40
-done
-
-# mds
-for mds in `seq 0 $((CEPH_NUM_MDS-1))`
-do
-  $CEPH_BIN/crun $norestart $CEPH_BIN/cmds $ARGS $CMDS_ARGS &
-
-#valgrind --tool=massif $CEPH_BIN/cmds $ARGS --mds_log_max_segments 2 --mds_thrash_fragments 0 --mds_thrash_exports 0 > m  #--debug_ms 20
-#$CEPH_BIN/cmds -d $ARGS --mds_thrash_fragments 0 --mds_thrash_exports 0 #--debug_ms 20
-#$CEPH_BIN/cmonctl mds set_max_mds 2
-done
-
-echo "started.  stop.sh to stop.  see out/* (e.g. 'tail -f out/????') for debug output."
-