CEPH POOL MIGRATION
从一个资源池迁移到另一个资源池,特别是资源池参数不可修改的,比如:从replicated pool 迁移到 EC pool,缩减 PGs 数量。
最简方法
ool=testpool
ceph osd pool create $pool.new 4096 4096 erasure default
rados cppool $pool $pool.new
ceph osd pool rename $pool $pool.old
ceph osd pool rename $pool.new $pool
N: 对于 EC pools可能会报错:“error copying pool testpool => newpool: (95) Operation not supported”.
使用 cache tier
使用时要小心,先做测试再用于生产环境
以相反的顺序使用 cache tier
举例:有2个pool 现在的testpool 和新的 newpool
1、安装 cache tier
ceph osd tier add newpool testpool --force-nonempty
ceph osd tier cache-mode testpool forward
在命令 `ceph osd dump` 下输出下面类似内容:
--> pool 58 'testpool' replicated size 3 .... tier_of 80
2、强制迁移所有对象到 newpool
rados -p testpoo