Appearance
Ceph Cluster 移除
卸载 Ceph 集群
- 停止
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
- 卸载
OSD
磁盘:
umount /var/lib/ceph/osd/*
umount /var/lib/ceph/osd/*
- 删除相关配置项:
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/*
- 擦除磁盘数据:
ceph-deploy disk zap stor1:/dev/sdb stor2:/dev/sdb
ceph-deploy disk zap stor1:/dev/sdb stor2:/dev/sdb
- 卸载相关软件包:
cd /root/ceph-cluster/
# 删除软件包
ceph-deploy purge stor1 stor2 stor3
cd /root/ceph-cluster/
# 删除软件包
ceph-deploy purge stor1 stor2 stor3
- 清除数据:
ceph-deploy purgedata stor1 stor2 stor3
ceph-deploy purgedata stor1 stor2 stor3
- 清除
keys
:
ceph-deploy forgetkeys
ceph-deploy forgetkeys
- 删除相关
LV
、VG
、PV
:
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
- 删除初始化配置信息:
[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 *
清除集群环境
- 重复[卸载 Ceph 集群](#卸载 Ceph 集群)的第
1
、2
、3
、9
步 - 在
mon
节点上,执行以下命令:
ceph-deploy new stor1
ceph-deploy new stor1
- 在每个节点上执行以下命令(该步骤可省略,因为下一步会自动为每个节点安装以下程序包):
sudo yum install ceph epel-release ceph-radosgw
sudo yum install ceph epel-release ceph-radosgw
- 在
mon
节点上执行:
ceph-deploy install --release nautilus stor1 stor2 stor3
ceph-deploy install --release nautilus stor1 stor2 stor3
- 初始化
mon
:
ceph-deploy mon create-initial
ceph-deploy mon create-initial
- 为每个节点传递
keys
:
ceph-deploy admin stor1 stor2 stor3
ceph-deploy admin stor1 stor2 stor3
- 添加
mgr
:
ceph-deploy mgr create stor1
ceph-deploy mgr create stor1
添加osd
参考[Ceph-deploy 集群快速部署](./Ceph-deploy 集群快速部署.md)