背景
希望升级至 ceph-14 版本(N)
ceph 要从 L 版升级到 N 版必须带标签 purged_snapdirs
# ceph osd dump | grep ^flag
flags sortbitwise,recovery_deletes,purged_snapdirs
ceph-12.2.0-0.el7.x86_64 无法增加 purged_snapdirs 标签,无法升级至 14 版
目的
需要把 ceph-12.2.0-0.el7.x86_64 先升级至 ceph-12.2.13-0.el7.x86_64
安全升级方案
原 ceph conf 配置
[global]
fsid = e9a58cad-c7b4-4d42-bdef-cc0311ed83f0
mon initial members = ns-ceph-208183,ns-ceph-208187,ns-ceph-208192
mon host = 10.189.208.183,10.189.208.197,10.189.208.192
public network = 10.189.208.0/22
cluster network = 240.30.128.0/21
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
osd journal size = 2048
filestore xattr use omap = true
osd pool default size = 3
osd pool default min size = 1
osd pool default pg num = 1024
osd pool default pgp num = 1024
osd crush chooseleaf type = 1
[mon]
mon osd full ratio = .95
mon osd nearfull ratio = .85
mon clock drift allowed = 10
mon clock drift warn backoff = 30
[mds.ns-ceph-208183]
host = ns-ceph-208183
[mds.ns-ceph-208192]
host = ns-ceph-208192
[mds.ns-ceph-208187]
host = ns-ceph-208187
ceph 状态
# ceph -s
cluster:
id: e9a58cad-c7b4-4d42-bdef-cc0311ed83f0
health: HEALTH_OK
services:
mon: 5 daemons, quorum ns-ceph-208183,ns-ceph-208184,ns-ceph-208187,ns-ceph-208188,ns-ceph-208192
mgr: ns-ceph-208183(active), standbys: ns-ceph-208187, ns-ceph-208192
mds: noah_fs-1/1/1 up {0=ns-ceph-208187=up:active}, 2 up:standby
osd: 50 osds: 50 up, 50 in
data:
pools: 4 pools, 3840 pgs
objects: 37590k objects, 53546 GB
usage: 157 TB used, 102150 GB / 257 TB avail
pgs: 3837 active+clean
2 active+clean+scrubbing+deep
1 active+clean+scrubbing
io:
client: 807 kB/s rd, 6535 kB/s wr, 810 op/s rd, 580 op/s wr
安全升级思路
1 删除 ceph mon 从 5 个变成 3 个
2 找两个新的电脑 A, B, 独立安装 ceph-12.2.0-0.el7.x86_64 版本
3 把 A, B 服务器加入到原集群,并创建为 mon 服务
4 验证当前有 5 个 MON
5 直接对 A, B 执行 ceph rpm 升级到 ceph-12.2.13 版本
6 升级成功即可以对原集群中剩余的 3 个 MON 执行升级(正常可安全无损升级,客户端无感知)
7 升级失败,回滚(剔除 AB MON 即可)
8 上述方案保证了原 ceph 安全健壮性不会一次过破坏 CEPH 集群
9 cephfs 升级重启需断开所有 client
执行过程
删除旧 mon 5 -> 3
# ceph mon remove ns-ceph-208184
removing mon.ns-ceph-208184 at 10.189.208.184:6789/0, there will be 4 monitors
# ceph mon remove ns-ceph-208188
removing mon.ns-ceph-208188 at 10.189.208.188:6789/0, there will be 3 monitors
同步 monmap
# monmaptool /etc/ceph/monmap --rm ns-ceph-208184
monmaptool: monmap file /etc/ceph/monmap
monmaptool: removing ns-ceph-208184
monmaptool: writing epoch 5 to /etc/ceph/monmap (4 monitors)
# monmaptool /etc/ceph/monmap --rm ns-ceph-208188
monmaptool: monmap file /etc/ceph/monmap
monmaptool: removing ns-ceph-208188
monmaptool: writing epoch 5 to /etc/ceph/monmap (3 monitors)
添加新 mon A, B
添加 ceph-mon, ceph-mgr
IP : 10.189.208.205 10.189.208.214
当前 ceph 版本, 与 10.189.208.183 一致, 先加入集群从 ceph mon 3 添加至 ceph mon 5 个