Upgrading Ceph

Each release of Ceph may have additional steps. Refer to the release notesdocument of your release to identify release-specific procedures for yourcluster before using the upgrade procedures.

Summary

You can upgrade daemons in your Ceph cluster while the cluster is online and inservice! Certain types of daemons depend upon others. For example, Ceph MetadataServers and Ceph Object Gateways depend upon Ceph Monitors and Ceph OSD Daemons.We recommend upgrading in this order:

  • Ceph Deploy

  • Ceph Monitors

  • Ceph OSD Daemons

  • Ceph Metadata Servers

  • Ceph Object Gateways

As a general rule, we recommend upgrading all the daemons of a specific type(e.g., all ceph-mon daemons, all ceph-osd daemons, etc.) to ensure thatthey are all on the same release. We also recommend that you upgrade all thedaemons in your cluster before you try to exercise new functionality in arelease.

The Upgrade Procedures are relatively simple, but do look at the releasenotes document of your release before upgrading. The basic process involvesthree steps:

  • Use ceph-deploy on your admin node to upgrade the packages formultiple hosts (using the ceph-deploy install command), or login to eachhost and upgrade the Ceph package using your distro’s package manager.For example, when Upgrading Monitors, the ceph-deploy syntax mightlook like this:
  1. ceph-deploy install --release {release-name} ceph-node1[ ceph-node2]
  2. ceph-deploy install --release firefly mon1 mon2 mon3

Note: The ceph-deploy install command will upgrade the packagesin the specified node(s) from the old release to the release you specify.There is no ceph-deploy upgrade command.

Important

Once you upgrade a daemon, you cannot downgrade it.

Ceph Deploy

Before upgrading Ceph daemons, upgrade the ceph-deploy tool.

  1. sudo pip install -U ceph-deploy

Or:

  1. sudo apt-get install ceph-deploy

Or:

  1. sudo yum install ceph-deploy python-pushy

Upgrade Procedures

The following sections describe the upgrade process.

Important

Each release of Ceph may have some additional steps. Refer tothe release notes document of your release for details BEFORE youbegin upgrading daemons.

Upgrading Monitors

To upgrade monitors, perform the following steps:

  • Upgrade the Ceph package for each daemon instance.

You may use ceph-deploy to address all monitor nodes at once.For example:

  1. ceph-deploy install --release {release-name} ceph-node1[ ceph-node2]
  2. ceph-deploy install --release hammer mon1 mon2 mon3

You may also use the package manager for your Linux distribution oneach individual node. To upgrade packages manually on each Debian/Ubuntuhost, perform the following steps:

  1. ssh {mon-host}
  2. sudo apt-get update && sudo apt-get install ceph

On CentOS/Red Hat hosts, perform the following steps:

  1. ssh {mon-host}
  2. sudo yum update && sudo yum install ceph
  • Restart each monitor. For Ubuntu distributions, use:
  1. sudo restart ceph-mon id={hostname}

For CentOS/Red Hat/Debian distributions, use:

  1. sudo /etc/init.d/ceph restart {mon-id}

For CentOS/Red Hat distributions deployed with ceph-deploy,the monitor ID is usually mon.{hostname}.

  • Ensure each monitor has rejoined the quorum:
  1. ceph mon stat

Ensure that you have completed the upgrade cycle for all of your Ceph Monitors.

Upgrading an OSD

To upgrade a Ceph OSD Daemon, perform the following steps:

  • Upgrade the Ceph OSD Daemon package.

You may use ceph-deploy to address all Ceph OSD Daemon nodes atonce. For example:

  1. ceph-deploy install --release {release-name} ceph-node1[ ceph-node2]
  2. ceph-deploy install --release hammer osd1 osd2 osd3

You may also use the package manager on each node to upgrade packagesusing your distro’s package manager. For Debian/Ubuntu hosts, perform thefollowing steps on each host:

  1. ssh {osd-host}
  2. sudo apt-get update && sudo apt-get install ceph

For CentOS/Red Hat hosts, perform the following steps:

  1. ssh {osd-host}
  2. sudo yum update && sudo yum install ceph
  • Restart the OSD, where N is the OSD number. For Ubuntu, use:
  1. sudo restart ceph-osd id=N

For multiple OSDs on a host, you may restart all of them with Upstart.

  1. sudo restart ceph-osd-all

For CentOS/Red Hat/Debian distributions, use:

  1. sudo /etc/init.d/ceph restart N
  • Ensure each upgraded Ceph OSD Daemon has rejoined the cluster:
  1. ceph osd stat

Ensure that you have completed the upgrade cycle for all of yourCeph OSD Daemons.

Upgrading a Metadata Server

To upgrade a Ceph Metadata Server, perform the following steps:

  • Upgrade the Ceph Metadata Server package. You may use ceph-deploy toaddress all Ceph Metadata Server nodes at once, or use the package manageron each node. For example:
  1. ceph-deploy install --release {release-name} ceph-node1
  2. ceph-deploy install --release hammer mds1

To upgrade packages manually, perform the following steps on eachDebian/Ubuntu host:

  1. ssh {mon-host}
  2. sudo apt-get update && sudo apt-get install ceph-mds

Or the following steps on CentOS/Red Hat hosts:

  1. ssh {mon-host}
  2. sudo yum update && sudo yum install ceph-mds
  • Restart the metadata server. For Ubuntu, use:
  1. sudo restart ceph-mds id={hostname}

For CentOS/Red Hat/Debian distributions, use:

  1. sudo /etc/init.d/ceph restart mds.{hostname}

For clusters deployed with ceph-deploy, the name is usually eitherthe name you specified on creation or the hostname.

  • Ensure the metadata server is up and running:
  1. ceph mds stat

Upgrading a Client

Once you have upgraded the packages and restarted daemons on your Cephcluster, we recommend upgrading ceph-common and client libraries(librbd1 and librados2) on your client nodes too.

  • Upgrade the package:
  1. ssh {client-host}
  2. apt-get update && sudo apt-get install ceph-common librados2 librbd1 python-rados python-rbd
  • Ensure that you have the latest version:
  1. ceph --version

If you do not have the latest version, you may need to uninstall, auto removedependencies and reinstall.