服务相关:
stemctl status ceph*.service ceph*.target #查看所有服务
systemctl stop ceph*.service ceph*.target #关闭所有服务
systemctl start ceph.target #启动服务
systemctl stop ceph-osd*.service # 关闭所有osd服务
systemctl stop ceph-mon*.service #关闭所有mon服务
sudo systemctl start ceph-osd@{id}
sudo systemctl start ceph-mon@{hostname}
sudo systemctl start ceph-mds@{hostname}
查看:
ceph -help #查看命令帮助
ceph -s #查看状态
ceph osd pool set rbd pg_num 1024 # 修改pg_num数量
ceph osd pool set rbd pg_num 1024 # 修改pgp_num数量
ceph osd tree #查看osd树
ceph osd pool ls #查看所有的osd池
ceph --admin-daemon /var/run/ceph/ceph-osd.11.asok config show # 查看指定的osd运行中的所有参数
rados df #查看储存池使用情况
rados -p rbd ls |sort
ceph osd pool get rbd pg_num
ceph osd pool get rbd pgp_num
ceph osd pool set rbd pg_num 1024
ceph osd pool set rbd pgp_num 1024
rdb相关:
rbd create --size {megabytes} {pool-name}/{image-name}
rbd list
rbd info RBD_NAME
rbd feature disable RBD_NAME FEATURE1 FEATURE1 ..
rbd map RBD_NAME #映射到系统内核
rbd showmapped #查看rbd映射条目
rbd unmap /dev/rbd0 # 取消内核映射
rbd resize --size 2048 RBD_NAME # to increase
rbd resize --size 2048 foo --allow-shrink #to decrease
rbd du {RBD_NAME} -p rbd #查看某个或所有Image的容量,-p 指定pool名
rbd diff RBD_NAME | awk '{ SUM += $2 } END { print SUM/1024/1024/1024 " GB" }' #查看rbd image当前占用大小
修改:
ceph tell # 使用tell命令手动临时修改组件的配置
[例如:集群状态恢复涉及数据回填时,加速回填速度]
ceph tell 'osd.*' injectargs '--osd-max-backfills 16' #默认为1
ceph tell 'osd.*' injectargs '--osd-recovery-max-active 8' #默认为4
标题:ceph常用命令
作者:Eric1997
地址:https://cloud.tencent.com/developer/article/1701384
QQ:1405249930 我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=1ybmt081c1348