一、ceph的正常卸載與非正常卸載
一、正常卸載(通過ceph-deploy卸載)
環境已安裝ceph-deploy
1、查看ceph-deploy的幫助信息
[cephde@controller03 cephcluster]$ ceph-deploy -h usage: ceph-deploy [-h] [-v | -q] [--version] [--username USERNAME] [--overwrite-conf] [--ceph-conf CEPH_CONF] COMMAND ... Easy Ceph deployment -^- / \ |O o| ceph-deploy v2.0.1 ).-.( '/|||\` | '|` | '|` Full documentation can be found at: http://ceph.com/ceph-deploy/docs optional arguments: -h, --help show this help message and exit -v, --verbose be more verbose -q, --quiet be less verbose --version the current installed version of ceph-deploy --username USERNAME the username to connect to the remote host --overwrite-conf overwrite an existing conf file on remote host (if present) --ceph-conf CEPH_CONF use (or reuse) a given ceph.conf file commands: COMMAND description new Start deploying a new cluster, and write a CLUSTER.conf and keyring for it. install Install Ceph packages on remote hosts. rgw Ceph RGW daemon management mgr Ceph MGR daemon management mds Ceph MDS daemon management mon Ceph MON Daemon management gatherkeys Gather authentication keys for provisioning new nodes. disk Manage disks on a remote host. osd Prepare a data disk on remote host. repo Repo definition management admin Push configuration and client.admin key to a remote host. config Copy ceph.conf to/from remote host(s) uninstall Remove Ceph packages from remote hosts. purgedata Purge (delete, destroy, discard, shred) any Ceph data from /var/lib/ceph purge Remove Ceph packages from remote hosts and purge all data. forgetkeys Remove authentication keys from the local directory. pkg Manage packages on remote hosts. calamari Install and configure Calamari nodes. Assumes that a repository with Calamari packages is already configured. Refer to the docs for examples (http://ceph.com/ceph-deploy/docs/conf.html) See 'ceph-deploy <command> --help' for help on a specific command
2、軟件環境:集群——三個節點
1、卸載軟件包
ceph-deploy purge controller01 ceph-deploy purge controller02 ceph-deploy purge controller03
2、刪除各種配置文件和生成的數據文件
ceph-deploy purgedata controller01 ceph-deploy purgedata controller02 ceph-deploy purgedata controller03
3、將卸載節點的認證密鑰從本地目錄移除
ceph-deploy forgetkeys<br><br>#檢查ceph-mon是否啟動 ps -ef|grep ceph or ps -A|grep ceph<br><br>#啟動ceph-mon ceph-mon --id=1
2、軟件環境:單節點
ceph-deploy purge controller01 ceph-deploy purgedata controller01 ceph-deploy forgetkeys
二、非正常卸載
1、ceph安裝失敗,想從頭再來,不用刪除客戶端。可以使用下面的命令將環境恢復到剛安裝完客戶端的狀態。
ps aux|grep ceph |awk '{print $2}'|xargs kill -9 ps aux|grep ceph |awk '{print $2}'|xargs kill -9 ps -ef|grep ceph
確保此時所有ceph進程都已經關閉!!!如果沒有關閉,多執行幾次。
2、如果想徹底清除環境,而不是想重新安裝。那么ceph軟件包也要卸載
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- mon /* rm -rf /var/lib/ceph/ tmp /* rm -rf /etc/ceph/* rm -rf /var/run/ceph/*
3、查看安裝哪些ceph相關的包
# rpm -qa|grep ceph ceph-base-12.2.8-0.el7.x86_64 centos-release-ceph-luminous-1.1-2.el7.centos.noarch ceph-mgr-12.2.8-0.el7.x86_64 ceph-mds-12.2.8-0.el7.x86_64 libcephfs2-12.2.8-0.el7.x86_64 ceph-12.2.8-0.el7.x86_64 ceph-common-12.2.8-0.el7.x86_64 ceph-mon-12.2.8-0.el7.x86_64 ceph-radosgw-12.2.8-0.el7.x86_64 ceph-deploy-2.0.1-0.noarch python-cephfs-12.2.8-0.el7.x86_64 ceph-osd-12.2.8-0.el7.x86_64 ceph-selinux-12.2.8-0.el7.x86_64
4、卸載
yum remove ceph
三、ceph 更換controller3 服務器,ceph需要處理的地方
1、刪除ceph-mon
ceph mon remove mon3
2、移除osd
ceph osd rm osd.6 ceph osd rm osd.7 ceph osd rm osd.8 ceph osd crush rm osd.6 ceph osd crush rm osd.7 ceph osd crush rm osd.8 ceph auth del osd.6 ceph auth del osd.7 ceph auth del osd.8