ceph osd pool 操作小计

#列出所有pool
root@ceph:~# ceph osd pool ls [detail] #新建pool
root@ceph:~# ceph osd pool create <poolname> <pg_num> #删除pool
root@ceph:~# ceph osd pool rm <pool-name> <pool-name> --yes-i-really-really-mean-it #重命名
root@ceph:~# ceph osd pool rename <poolname> <poolname> #获取和设置pool的相关数据
root@ceph:~# ceph osd pool set <poolname> <var>
root@ceph:~# ceph osd pool get <poolname> <var>
<var>:size|min_size|
crash_replay_interval|pg_num|pgp_num|
crush_ruleset|hashpspool|nodelete|
nopgchange|nosizechange|write_fadvise_
dontneed|noscrub|nodeep-scrub|hit_set_
type|hit_set_period|hit_set_count|hit_
set_fpp|auid|target_max_objects|target_
max_bytes|cache_target_dirty_ratio|
cache_target_dirty_high_ratio|cache_
target_full_ratio|cache_min_flush_age|
cache_min_evict_age|erasure_code_
profile|min_read_recency_for_promote|
all|min_write_recency_for_promote|fast_
read|hit_set_grade_decay_rate|hit_set_
search_last_n|scrub_min_interval|scrub_
max_interval|deep_scrub_interval|
recovery_priority|recovery_op_priority|
scrub_priority

rbd 操作小计

#列出指定pool的镜像
root@ceph:~# rbd ls|list [--pool|-p <pool>] #列出指定pool的镜像
root@ceph:~# rbd rm|remove <image-name> [--pool|-p <pool>] #新建镜像,可以用-p|--pool参数或者<pool-name>/<image-name>方式指定pool
root@ceph:~# rbd create [<pool-name>/]<image-name> -p|--pool <pool-name> -s|--size <image-size> #将镜像映射到块设备
root@ceph:~# rbd map [<pool-name>/]<image-name>[@<snap-name>] -p|--pool <pool-name> #取消映射
root@ceph:~# rbd unmap [<pool-name>/]<image-name>[@<snap-name>] -p|--pool <pool-name> #调整镜像大小
root@ceph:~# rbd resize [<pool-name>/]<image-name> -p|--pool <pool-name> --image <image-name> -s|--size <image-size> --allow-shrink

rados 操作小计

#列出所有pool
root@ceph:~# rados lspools #创建pool [with auid 123[and using crush rule 4]]
root@ceph:~# rados mkpool <pool-name> [123[ 4]] #复制pool的内容到另一个poo
root@ceph:~# rados cppool <pool-name> <dest-pool> #删除pool
root@ceph:~# rados rmpool <pool-name> <pool-name> --yes-i-really-really-mean-it #清空pool里的内容
root@ceph:~# rados purge <pool-name> --yes-i-really-really-mean-it #show per-pool and total usage
root@ceph:~# rados df [-p|--pool <pool-name>] #list objects in pool
root@ceph:~# rados ls -p|--pool <pool-name>
05-17 03:44