Skip to content
On this page

Ceph Cluster 移除

卸载 Ceph 集群

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

清除集群环境

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

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