ceph更换磁盘步骤


我们经常面临 ceph的磁盘损坏,需要更换磁盘。以下是更换磁盘的步骤:

note: when disk is bad and the raid0, afterreboot, dev number(sdh, sdi) will be changed for no raid conf for this newdisk. it will cause journal dev number is changed, and osd can not be started

1. 查询osd和磁盘的信息

ceph osd tree #get the osd id:

sdi is ssd dev partition for osd journal

for i in `ls -1`; do ls -la $i/; done  #get ssd dev

 ceph -s #check pg status #确保pg是active状态

 

2. osd删除,在任意节点上执行

ceph osd out {osd-num}

/etc/init.d/ceph stop osd.{osd-num}

ceph osd crush remove osd.{osd-num}

ceph auth del osd.{osd-num}

ceph osd rm {osd-num}

 ceph -s #check pg status #确保pg是active状态

3. 新增osd. 在任意节点上执行.

在/opt/ceph-deploy 目录,执行

# ceph-deploy --overwrite-conf  osd prepare node-xx:/dev/sde:/dev/sdi1

# ceph-deploy --overwrite-conf  osd activate node-xx:/dev/sde1:/dev/sdi1

activate时磁盘已分区,注意加分区号

  ceph -s #check pg status #确保pg是active状态

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值