~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/vstart.sh

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-02-05 10:07:38 UTC
  • mfrom: (1.1.7) (0.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120205100738-00s0bxx93mamy8tk
Tags: 0.41-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
conf="ceph.conf"
24
24
 
25
 
keyring_fn=".ceph_keyring"
 
25
keyring_fn="keyring"
26
26
osdmap_fn="/tmp/ceph_osdmap.$$"
27
27
monmap_fn="/tmp/ceph_monmap.$$"
28
28
 
257
257
 
258
258
 
259
259
if [ "$start_mon" -eq 1 ]; then
260
 
        if [ "$new" -eq 1 ]; then
261
 
        # build and inject an initial osd map
262
 
                $CEPH_BIN/osdmaptool --clobber --createsimple $CEPH_NUM_OSD $osdmap_fn --pg_bits 2 --pgp_bits 4 -c $conf
263
 
        fi
264
260
 
265
261
        if [ "$new" -eq 1 ]; then
266
262
                if [ $overwrite_conf -eq 1 ]; then
267
263
                        cat <<EOF > $conf
268
264
; generated by vstart.sh on `date`
269
265
[global]
270
 
        keyring = .ceph_keyring
 
266
        keyring = keyring
 
267
        osd pg bits = 3
 
268
        osd pgp bits = 5  ; (invalid, but ceph should cope!)
271
269
$extra_conf
272
270
EOF
273
271
                        [ "$cephx" -eq 1 ] && cat<<EOF >> $conf
330
328
 
331
329
                for f in $MONS
332
330
                do
333
 
                    cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf -i $f --monmap=$monmap_fn --osdmap=$osdmap_fn"
 
331
                    cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf -i $f --monmap=$monmap_fn"
334
332
                    [ "$cephx" -eq 1 ] && cmd="$cmd --keyring=$keyring_fn"
335
333
                    echo $cmd
336
334
                    $cmd
345
343
                do
346
344
                    run 'mon' $CEPH_BIN/ceph-mon -i $f $ARGS $CMON_ARGS
347
345
                done
348
 
                sleep 1
349
346
        fi
350
347
fi
351
348
 
352
 
rm $osdmap_fn
353
 
 
354
349
#osd
355
350
if [ "$start_osd" -eq 1 ]; then
356
351
    for osd in `seq 0 $((CEPH_NUM_OSD-1))`
367
362
        keyring = dev/osd$osd/keyring
368
363
EOF
369
364
            fi
370
 
            echo mkfs osd$osd
371
 
            cmd="$SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --mkkey"
372
 
            echo $cmd
373
 
            $cmd
 
365
 
 
366
            echo add osd$osd
 
367
            $SUDO $CEPH_ADM osd create $osd
 
368
            $SUDO $CEPH_ADM osd crush add $osd osd.$osd 1.0 host=localhost rack=localrack pool=default
 
369
            $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --mkkey
374
370
 
375
371
            if [ "$cephx" -eq 1 ]; then
376
372
                key_fn=dev/osd$osd/keyring