Ceph集群维护

Ceph搭建其实挺easy的,但是要维护Ceph就不那么简单了,最最重要的知道什么阶段需要怎么处理,以及会产生什么后果,以及如何回退….

  • 迁移相关虚拟机/业务至其他节点(openstack等需要把虚拟机迁移出去);

在MON或者有admin权限的节点执行操作:

# 设置OSD的锁定
for i in noout nobackfill norecovery;do ceph osd set $i;done
# 完成机器维护后,加电,重新同步数据
for i in noout nobackfill norecovery;do ceph osd unset $i;done

# start/stop all ceph-mds@.service instances at once
systemctl start/stop/restart ceph-mds.target
# start/stop all ceph-mgr@.service instances at once
systemctl start/stop/restart ceph-mgr.target
# start/stop all ceph-mon@.service instances at once
systemctl start/stop/restart ceph-mon.target
# start/stop all ceph-osd@.service instances at once
systemctl start/stop/restart ceph-osd.target
# start/stop all ceph-radosgw@.service instances at once
systemctl start/stop/restart ceph-radosgw.target
# start/stop all ceph*@.service instances at once
systemctl start/stop/restart ceph.target				

# 检查集群状态
ceph health
ceph status
ceph quorum_status
ceph mon_status
# 观察集群内正发生的事件
ceph -w/-s
 
# 检查集群的使用情况
ceph df
# 检查 OSD 状态
ceph osd stat
ceph osd dump
# 打印 CRUSH 树
ceph osd tree
 
# 检查 Mon 状态
ceph mon stat
ceph mon dump
# 检查MON法定人数状态
ceph quorum_status -f json-pretty
 
# 检查 MDS 状态
ceph mds stat
ceph mds dump
 
# 监控 PG
ceph pg dump
# 查看指定 PG 的 Acting Set 或 Up Set 中包含的 OSD
ceph pg map {pg-num}
  • storage/ceph/ceph集群维护.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)