]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: don't generate initial osdmap explicitly
authorSage Weil <sage.weil@dreamhost.com>
Sat, 12 Nov 2011 21:42:38 +0000 (13:42 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 12 Nov 2011 21:42:38 +0000 (13:42 -0800)
This is simpler and exercises the monitors ability to start with a generic
osdmap and build it out as new osds are added to the cluster.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/vstart.sh

index d848333a8fa4aabc3d0da33af9063276a876f84a..e56277ed06f5cf577134bba01f2e04843300f1eb 100755 (executable)
@@ -257,10 +257,6 @@ DAEMONOPTS="
 
 
 if [ "$start_mon" -eq 1 ]; then
-       if [ "$new" -eq 1 ]; then
-       # build and inject an initial osd map
-               $CEPH_BIN/osdmaptool --clobber --createsimple $CEPH_NUM_OSD $osdmap_fn --pg_bits 2 --pgp_bits 4 -c $conf
-       fi
 
        if [ "$new" -eq 1 ]; then
                if [ $overwrite_conf -eq 1 ]; then
@@ -268,6 +264,8 @@ if [ "$start_mon" -eq 1 ]; then
 ; generated by vstart.sh on `date`
 [global]
         keyring = .ceph_keyring
+        osd pg bits = 3
+        osd pgp bits = 5  ; (invalid, but ceph should cope!)
 $extra_conf
 EOF
                        [ "$cephx" -eq 1 ] && cat<<EOF >> $conf
@@ -330,7 +328,7 @@ EOF
 
                for f in $MONS
                do
-                   cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf -i $f --monmap=$monmap_fn --osdmap=$osdmap_fn"
+                   cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf -i $f --monmap=$monmap_fn"
                    [ "$cephx" -eq 1 ] && cmd="$cmd --keyring=$keyring_fn"
                    echo $cmd
                    $cmd
@@ -345,12 +343,9 @@ EOF
                do
                    run 'mon' $CEPH_BIN/ceph-mon -i $f $ARGS $CMON_ARGS
                done
-               sleep 1
        fi
 fi
 
-rm $osdmap_fn
-
 #osd
 if [ "$start_osd" -eq 1 ]; then
     for osd in `seq 0 $((CEPH_NUM_OSD-1))`
@@ -367,10 +362,11 @@ EOF
         keyring = dev/osd$osd/keyring
 EOF
            fi
-           echo mkfs osd$osd
-           cmd="$SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --mkkey"
-           echo $cmd
-           $cmd
+
+           echo add osd$osd
+           $SUDO $CEPH_ADM osd create $osd
+           $SUDO $CEPH_ADM osd crush add $osd osd.$osd 1.0 domain=root
+           $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --mkkey
 
            if [ "$cephx" -eq 1 ]; then
                key_fn=dev/osd$osd/keyring