池管理

查看pool

[root@ceph01 ~]# ceph osd lspools
1 ssd-demo-pool
2 nvme-demo-pool

创建一个pool

格式

ceph osd pool create {pool-name} {pg-num} [{pgp-num}] [replicated] \
         [crush-rule-name] [expected-num-objects]

ceph osd pool create {pool-name} {pg-num}  {pgp-num}   erasure \
         [erasure-code-profile] [crush-rule-name] [expected_num_objects]

删除池

  • 语法格式
ceph osd pool delete {pool-name} [{pool-name} --yes-i-really-really-mean-it]
  • 修改配置
vim /etc/ceph/ceph.conf
  • 添加如下:
[mon]
mon_allow_pool_delete=true
  • 更新
cd /etc/ceph
ceph-deploy --overwrite-conf config push ceph01 ceph02 ceph03
  • 重启
systemctl restart ceph-mon.target
  • 删除ddd-pool
[root@ceph01 ceph]# ceph osd pool delete ddd-pool ddd-pool --yes-i-really-really-mean-it
    pool 'ddd-pool' removed

池重命名

ceph osd pool rename {current-pool-name} {new-pool-name}

显示池统计信息

[root@ceph01 ~]# rados df
POOL_NAME        USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS  RD WR_OPS    WR USED COMPR UNDER COMPR
nvme-demo-pool 12 KiB       1      0      3                  0       0        0      0 0 B      1 1 KiB        0 B         0 B
ssd-demo-pool  12 KiB       1      0      3                  0       0        0      0 0 B      1 1 KiB        0 B         0 B

total_objects    2
total_used       30 GiB
total_avail      26 TiB
total_space      26 TiB

查看池io

[root@ceph01 ~]# ceph osd pool stats ssd-demo-pool
pool ssd-demo-pool id 1
  nothing is going on

创建池快照

# ceph osd pool mksnap {pool-name} {snap-name}
[root@ceph01 ~]# ceph osd pool mksnap ssd-demo-pool ssd-demo-pool-snap-20210301
created pool ssd-demo-pool snap ssd-demo-pool-snap-20210301

删除池快照

# ceph osd pool rmsnap {pool-name} {snap-name}
[root@ceph01 ~]# ceph osd pool rmsnap ssd-demo-pool ssd-demo-pool-snap-20210301
removed pool ssd-demo-pool snap ssd-demo-pool-snap-20210301
Copyright © weiliang 2021 all right reserved,powered by Gitbook本书发布时间: 2024-04-22 16:03:41

results matching ""

    No results matching ""