需要安装ceph-deploy,如果未安装执行以下命令安装:

sudo yum install ceph-deploy python-pushy

版本号查看:https://docs.ceph.com/en/latest/releases/#ceph-releases-index

运行升级命令:

ceph-deploy install --release {release-name} ceph-node1[ ceph-node2]
例如:
ceph-deploy install --release nautilus ceph-node-1 ceph-node-2 ceph-node-3  ceph-node-4

设置OSD noout避免产生rebalance

ceph osd set noout

重启mon及osd进程

for i in $MON; do
    ssh $i sudo systemctl restart ceph-mon@*
    sleep 3s
done

for i in $OSD; do
    ssh $i sudo systemctl restart ceph-osd@*
    sleep 3s

done

去掉设置OSD noout

ceph osd unset noout

也可以暴力直接重启CEPH守护进程,但留意一个个节点来,要等恢复后再下一个节点

systemctl restart ceph.target

检查版本升级情况

ceph tell mon.* version
ceph tell osd.* version


Centos7使用ceph-deploy2.0.1升级到octopus版本时会报错类似:

[ceph-node-1][INFO  ] Running command: yum install -y https://download.ceph.com/rpm-octopus/el7/noarch/ceph-release-1-0.el7.noarch.rpm
[ceph-node-1][DEBUG ] 已加载插件:fastestmirror, priorities
[ceph-node-1][WARNIN] 无法打开 https://download.ceph.com/rpm-octopus/el7/noarch/ceph-release-1-0.el7.noarch.rpm ,跳过。
[ceph-node-1][WARNIN] 错误:无须任何处理
[ceph-node-1][ERROR ] RuntimeError: command returned non-zero exit status: 1
[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: yum install -y https://download.ceph.com/rpm-octopus/el7/noarch/ceph-release-1-0.el7.noarch.rpm

解决方案:

cd /usr/lib/python2.7/site-packages/ceph_deploy/hosts/centos

sed -i -e "s/.*ceph-release-1-0.*/'{url}noarch/ceph-release-1-1.el7.noarch.rpm'.format(url=url),/" install.py

mv install.pyo install.pyox
mv install.pyc install.pycx

参考:

http://docs.ceph.org.cn/install/upgrading-ceph/
https://www.cnblogs.com/bodhitree/p/6043381.html
https://stackoverflow.com/questions/66536101/ceph-deploy-install-release-octopus-on-centos7-tries-to-load-non-existing-ceph

标签: Ceph

添加新评论