Skip to content

Ceph Cluster 移除

Ceph Cluster 移除

卸载 Ceph 集群

  1. 停止ceph相关服务:
Terminal window
ps aux|grep ceph |awk '{print $2}'|xargs kill -9
# 检查是否成功停止服务
ps -ef|grep ceph
  1. 卸载OSD磁盘:
Terminal window
umount /var/lib/ceph/osd/*
  1. 删除相关配置项:
Terminal window
rm -rf /var/lib/ceph/osd/*
rm -rf /var/lib/ceph/mon/*
rm -rf /var/lib/ceph/mds/*
rm -rf /var/lib/ceph/bootstrap-mds/*
rm -rf /var/lib/ceph/bootstrap-osd/*
rm -rf /var/lib/ceph/bootstrap-rgw/*
rm -rf /var/lib/ceph/bootstrap-mgr/*
rm -rf /var/lib/ceph/tmp/*
rm -rf /etc/ceph/*
rm -rf /var/run/ceph/*
  1. 擦除磁盘数据:
Terminal window
ceph-deploy disk zap stor1:/dev/sdb stor2:/dev/sdb
  1. 卸载相关软件包:
Terminal window
cd /root/ceph-cluster/
# 删除软件包
ceph-deploy purge stor1 stor2 stor3
  1. 清除数据:
Terminal window
ceph-deploy purgedata stor1 stor2 stor3
  1. 清除keys
Terminal window
ceph-deploy forgetkeys
  1. 删除相关LVVGPV
Terminal window
lvdisplay | grep /dev/ceph* | awk '{print $3}' | xargs lvremove -f
vgdisplay | grep ceph | awk '{print $3}' | xargs vgremove -f
pvremove /dev/sdb
  1. 删除初始化配置信息:
Terminal window
[root@stor1 ceph-cluster]\# pwd
/root/ceph-cluster
[root@stor1 ceph-cluster]\# rm -f *

清除集群环境

  1. 重复[卸载 Ceph 集群](#卸载 Ceph 集群)的第1239
  2. mon节点上,执行以下命令:
Terminal window
ceph-deploy new stor1
  1. 在每个节点上执行以下命令(该步骤可省略,因为下一步会自动为每个节点安装以下程序包):
Terminal window
sudo yum install ceph epel-release ceph-radosgw
  1. mon节点上执行:
Terminal window
ceph-deploy install --release nautilus stor1 stor2 stor3
  1. 初始化mon
Terminal window
ceph-deploy mon create-initial
  1. 为每个节点传递keys
Terminal window
ceph-deploy admin stor1 stor2 stor3
  1. 添加mgr
Terminal window
ceph-deploy mgr create stor1

添加osd参考[Ceph-deploy 集群快速部署](./Ceph-deploy 集群快速部署.md)