码迷,mamicode.com
首页 > 其他好文 > 详细

osd journal 一键迁移脚本

时间:2015-04-17 11:53:23      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:


    #!/bin/bash
    osd_id=$1
    journal_dev=$2
    if [ $# -lt 2 ]
    then
    echo "example: osd_journal_migration.sh 0 /dev/sdb1"
    exit 0
    fi
    service ceph-osd stop id=$osd_id
    ceph-osd --flush-journal -i $osd_id
    sleep 2
    mv /var/lib/ceph/osd/ceph-$osd_id/journal /var/lib/ceph/osd/ceph-$osd_id/journal_old
    ln -s $journal_dev /var/lib/ceph/osd/ceph-$osd_id/journal
    ceph-osd --mkjournal -i $osd_id
    sleep 3
    service ceph-osd restart id=$osd_id
    echo "****new journal path info:****"
    ls -la /var/lib/ceph/osd/ceph-$osd_id/journal
    ceph osd tree
    echo "****if fail run cmd:****"
    echo "service ceph-osd restart id=$osd_id"

osd journal 一键迁移脚本

标签:

原文地址:http://my.oschina.net/diluga/blog/402779

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!