Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to realize Environmental cleanup by ceph

Shulou Source: shulou.com Published: 2022-05-31 18:40:01 09月21日 Update

This article mainly introduces how ceph realizes environmental clean-up, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

Automates environment cleanup of a single node's ceph mon and osd, suitable for multiple deployments of test environments without wanting to reinstall the operating system. Tested by ubuntu 12.04.x

#!/ bin/bash service ceph-osd-all stop service ceph-mon-all stop rm -fr /var/lib/ceph/bootstrap-mds/* rm -fr /var/lib/ceph/bootstrap-osd/* rm -fr /var/lib/ceph/mds/* rm -fr /var/lib/ceph/mon/* rm -fr /var/lib/ceph/tmp/* #osd_list=`mount|grep osd|awk '{print $3}'|awk -F'-' '{print $2}'` osd_list=`ls /var/lib/ceph/osd|awk -F- '{print $2}'` for var in $osd_list; do echo "ceph osd out $var" ceph osd out $var echo "service ceph-osd stop id=$var" service ceph-osd stop id=$var echo "ceph osd crush remove osd.$ var" ceph osd crush remove osd.$ var echo "ceph auth del osd.$ var" ceph auth del osd.$ var echo "ceph osd rm $var" ceph osd rm $var echo "umount /var/lib/ceph/osd/ceph-$var" umount /var/lib/ceph/osd/ceph-$var echo "rm dir /var/lib/ceph/osd/ceph-$var" rm -rf /var/lib/ceph/osd/ceph-$var done disk_list=`mount |grep osd|awk '{print $1}'` for var in $disk_list; do sgdisk --zap-all -- $var sgdisk --clear --mbrtogpt -- $var partprobe $var done rm /etc/ceph/ceph* Thank you for reading this article carefully. I hope that the article "how to clean up the environment" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Tags: Environment articles tests operating systems values interests single at the same time more friends knowledge systems editing nodes industries information information channels channels references learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno Apple Xiaomi Redmi