~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/vstart.sh

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        debug osd = 25
166
166
        debug monc = 20
167
167
        debug journal = 20
168
 
        debug filestore = 20'
 
168
        debug filestore = 20
 
169
        debug objclass = 20'
169
170
    CMDSDEBUG='
170
171
        lockdep = 1
171
172
        debug ms = 1
204
205
 
205
206
 
206
207
# figure machine's ip
 
208
HOSTNAME=`hostname`
207
209
if [ "$localhost" -eq 1 ]; then
208
210
    IP="127.0.0.1"
209
211
else
210
 
    HOSTNAME=`hostname`
211
212
    echo hostname $HOSTNAME
212
213
    RAW_IP=`hostname --ip-address`
213
214
    # filter out IPv6 and localhost addresses
260
261
                        cat <<EOF > $conf
261
262
; generated by vstart.sh on `date`
262
263
[global]
263
 
        keyring = keyring
264
264
        osd pg bits = 3
265
265
        osd pgp bits = 5  ; (invalid, but ceph should cope!)
266
266
$extra_conf
269
269
        auth supported = cephx
270
270
EOF
271
271
                        cat <<EOF >> $conf
 
272
 
 
273
[client]
 
274
        keyring = keyring
 
275
 
272
276
[mds]
273
277
$DAEMONOPTS
274
278
$CMDSDEBUG
275
279
        mds debug frag = true
276
280
        mds debug auth pins = true
277
281
        mds debug subtrees = true
 
282
        mds data = dev/mds.\$id
278
283
[osd]
279
284
$DAEMONOPTS
 
285
        osd data = dev/osd\$id
 
286
        osd journal = dev/osd\$id.journal
 
287
        osd journal size = 100
280
288
        osd class tmp = out
281
289
        osd class dir = .libs
282
290
        osd scrub load threshold = 5.0
285
293
[mon]
286
294
$DAEMONOPTS
287
295
$CMONDEBUG
288
 
 
 
296
        mon cluster log file = out/cluster.mon.\$id.log
289
297
EOF
290
298
                fi
291
299
 
298
306
                        echo
299
307
                fi
300
308
 
301
 
                [ "$cephx" -eq 1 ] && $SUDO $CEPH_BIN/ceph-authtool --create-keyring --gen-key --name=mon. $keyring_fn
302
 
                [ "$cephx" -eq 1 ] && $SUDO $CEPH_BIN/ceph-authtool --gen-key --name=client.admin --set-uid=0 \
 
309
                $SUDO $CEPH_BIN/ceph-authtool --create-keyring --gen-key --name=mon. $keyring_fn
 
310
                $SUDO $CEPH_BIN/ceph-authtool --gen-key --name=client.admin --set-uid=0 \
303
311
                    --cap mon 'allow *' \
304
312
                    --cap osd 'allow *' \
305
313
                    --cap mds allow \
314
322
                        if [ $overwrite_conf -eq 1 ]; then
315
323
                                cat <<EOF >> $conf
316
324
[mon.$f]
 
325
        host = $HOSTNAME
317
326
        mon data = dev/mon.$f
318
327
        mon addr = $IP:$(($CEPH_PORT+$count))
319
328
EOF
352
361
            if [ $overwrite_conf -eq 1 ]; then
353
362
                    cat <<EOF >> $conf
354
363
[osd.$osd]
355
 
        osd data = dev/osd$osd
356
 
        osd journal = dev/osd$osd.journal
357
 
        osd journal size = 100
358
 
EOF
359
 
                    [ "$cephx" -eq 1 ] && cat <<EOF >> $conf
360
 
        keyring = dev/osd$osd/keyring
361
 
EOF
 
364
        host = $HOSTNAME
 
365
EOF
 
366
                    rm -rf dev/osd$osd || true
 
367
                    for f in dev/osd$osd/* ; do btrfs sub delete $f || true ; done || true
 
368
                    mkdir -p dev/osd$osd
362
369
            fi
363
370
 
364
371
            uuid=`uuidgen`
367
374
            $SUDO $CEPH_ADM osd crush set $osd osd.$osd 1.0 host=localhost rack=localrack pool=default
368
375
            $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --mkkey --osd-uuid $uuid
369
376
 
370
 
            if [ "$cephx" -eq 1 ]; then
371
 
                key_fn=dev/osd$osd/keyring
372
 
                echo adding osd$osd key to auth repository
373
 
                $SUDO $CEPH_ADM -i $key_fn auth add osd.$osd osd "allow *" mon "allow rwx"
374
 
            fi
 
377
            key_fn=dev/osd$osd/keyring
 
378
            echo adding osd$osd key to auth repository
 
379
            $SUDO $CEPH_ADM -i $key_fn auth add osd.$osd osd "allow *" mon "allow rwx"
375
380
        fi
376
381
        echo start osd$osd
377
382
        run 'osd' $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS $COSD_ARGS
392
397
    for name in a b c d e f g h i j k l m n o p
393
398
    do
394
399
        if [ "$new" -eq 1 ]; then
395
 
            key_fn=dev/mds.$name.keyring
 
400
            mkdir -p dev/mds.$name
 
401
            key_fn=dev/mds.$name/keyring
396
402
            if [ $overwrite_conf -eq 1 ]; then
397
403
                cat <<EOF >> $conf
398
404
[mds.$name]
399
 
EOF
400
 
                if [ "$cephx" -eq 1 ]; then
401
 
                    cat <<EOF >> $conf
402
 
        keyring = $key_fn
403
 
EOF
404
 
                fi
 
405
        host = $HOSTNAME
 
406
EOF
405
407
                if [ "$standby" -eq 1 ]; then
 
408
                    mkdir -p dev/mds.${name}s
406
409
                    cat <<EOF >> $conf
407
410
       mds standby for rank = $mds
408
411
[mds.${name}s]
409
 
        keyring = dev/mds.${name}s.keyring
410
412
        mds standby replay = true
411
413
        mds standby for name = ${name}
412
414
EOF
416
418
            $SUDO $CEPH_ADM -i $key_fn auth add mds.$name mon 'allow *' osd 'allow *' mds 'allow'
417
419
            if [ "$standby" -eq 1 ]; then
418
420
                    $SUDO $CEPH_BIN/ceph-authtool --create-keyring --gen-key --name=mds.${name}s \
419
 
                        dev/mds.${name}s.keyring
420
 
                    $SUDO $CEPH_ADM -i dev/mds.${name}s.keyring auth add mds.${name}s \
 
421
                        dev/mds.${name}s/keyring
 
422
                    $SUDO $CEPH_ADM -i dev/mds.${name}s/keyring auth add mds.${name}s \
421
423
                        mon 'allow *' osd 'allow *' mds 'allow'
422
424
            fi
423
425
        fi