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

猜你喜欢

转载自www.cnblogs.com/happy-king/p/9668159.html