ceph常用命令

1.删除osd
a)冻结需要删除的osd
[[email protected] ~]# ceph osd out osd.4
marked out osd.4.

b)用ceph -w 查看被冻结的osd迁移动作,迁移结束后继续(无读写)

c)停止要删除的osd的进程或者服务
[[email protected] ~]# /etc/init.d/ceph stop osd.4
=== osd.4 ===
Stopping Ceph osd.4 on node05...kill 4118...kill 4118...done

d)从集群中移除osd daemon信息:crushmap、key、data、journal
任意ceph osd/mon节点上执行:

[[email protected] ~]# ceph osd crush remove osd.4
removed item id 4 name 'osd.4' from crush map
[[email protected] ~]# ceph auth del osd.4
updated
[[email protected] ~]# ceph osd rm 4
removed osd.4

e)修改剩余节点配置
vi ceph.conf
移除相应osd.4的信息

2. rbd_cache相关

将/etc/ceph/ceph.conf和/ceph/ceph.conf下的rbdcache关闭,
[client]
rbd_cache = false
bd_cache_max_dirty = 0

测试cache是否关闭方法

rbd -p GPool1 bench-write jzh --io-size 4096 --io-threads 256 --io-total 1024000000 --io-pattern seq

ceph常用命令



测试rbd是否关闭cache方法,如果结果只有7行,则表明cache扔在使用,如果有76行,则表明cache已经关闭


3.ceph daemon mon.ceph01 mon_status  查看mon状态