自学内容网 自学内容网

【星海随笔】删除ceph

cephadm shell

ceph osd set noout
ceph osd set norecover
ceph osd set norebalance
ceph osd set nobackfill
ceph osd set nodown
ceph osd set pause

参考文献:
https://blog.csdn.net/lyf0327/article/details/90294011

systemctl stop ceph-osd.target

yum remove ceph-common ceph-mon ceph-osd
OR
apt-get remove ceph-common ceph-mon ceph-osd

rm -rf /etc/ceph

/var/lib/ceph/osd
/var/lib/ceph/mon
/etc/systemd/system/ceph*.service
/var/run/ceph

# 主要是这四个目录下的文件
rm -rf /etc/ceph/*
rm -rf /var/lib/ceph/*
rm -rf /var/log/ceph/*
rm -rf /var/run/ceph/*

for i in $(lsblk | awk  '/ceph/{print $1}' | awk -F "└─" '/ceph/{print $2}');do dmsetup remove $i;done

lsblk | awk '/ceph/{print $1}' | awk '/ceph/{print $2}' | awk '{print substr($0,3)}'


# 注意特殊节点有系统盘是nvme,这条命令执行前需要谨慎查看。lsblk
for i in $(lsblk | awk '/nvme/{print $1}');do wipefs -a /dev/$i;done

 for i in `lsblk | grep sd | grep -v sda  | awk '{print $1}'` ; do wipefs -a /dev/$i ; done

lsblk -f

## 如果之前有遗留的环境,需要先删除自动添加的osd
ceph osd tree

## 删除操作 
#!/bin/bash

for i in `seq 1 39`
do
ceph osd stop $i
sleep 0.1
ceph osd out $i
sleep 0.1
ceph osd crush rm osd.$i
sleep 0.1
ceph auth del osd.$i
sleep 0.1 
ceph osd rm $i
done

openstack server list --all  

openstack server list --all | awk 'NR>3{print $2}' > /tmp/1.txt

# for i in `cat /tmp/1.txt`; do XXX ;done

openstack server stop $i
openstack server delete $i
kayobe overcloud service destroy --yes-i-really-really-mean-it

在这里插入图片描述


原文地址:https://blog.csdn.net/weixin_41997073/article/details/144747343

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!