17. Removing a node from Ceph cluster

17.1. Remove OSD from the cluster

  • Take OSD out of the cluster and bring it down, for example osd.3:

ceph osd out osd.3
ceph osd down osd.3
  • Stop the OSD deamon on the node which runs the OSD:

systemctl stop ceph-osd@3.service
  • Remove the OSD completely from the cluster:

ceph osd purge osd.3 --yes-i-really-mean-it

17.2. Stop the metadata and manager daemons on the node

ceph mds ok-to-stop node10
systemctl stop ceph-mds@node10.service
systemctl stop ceph-mgr@node10.service

17.3. Remove the monitor

  • On the surviving monitor, remove the other monitor:

ceph mon remove node10
  • Stop the monitor daemon on the node:

systemctl stop ceph-mon@node10

17.4. Remove the node from the configuration file

  • Edit /etc/ceph/ceph.conf file and remove the node IP address from mon_host line.

  • Restart the monitor

systemctl restart ceph-mon@node06

17.5. Remove the node from the crash map

  • In the dashboard, the node still shows up in the crash map.

  • To remove it, we need to decompile the crash map, then modify it.

  • Dump the crash map in file /tmp/crash:

ceph osd getcrushmap -o /tmp/crush
  • Decompile the file:

crushtool -d  /tmp/crush -o /tmp/crush_decomp
  • Edit file /tmp/crash_decomp and remove all the entries and blocks related to the removed node.

  • Compile the modified crash map:

crushtool -c  /tmp/crush_decomp -o /tmp/crush_new
  • Import the modified crash map:

ceph osd setcrushmap -i /tmp/crush_new
  • Check the ceph status:

ceph -s