ceph的正常卸载与非正常卸载

 


一、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
复制代码

 

posted @   思维无界限  阅读(4014)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示

目录导航