Ceph is open source software that combines many servers and their drives into one shared storage system. Every block of data is stored several times on different servers, so losing a drive or an entire server does not cost any data. Virtual machines whose disks live in Ceph are therefore not tied to the hardware of a single host.
Key facts
- Type
- Distributed, software-defined storage
- License
- Open source
- Core components
- OSD for data, MON for cluster state
- Usual replication
- 3 copies on different servers
- On failure
- Copies are recreated automatically
- Key limitation
- Does not replace a backup
How does Ceph work?
Ceph connects several storage servers over the network to form a cluster. Data is split into objects, typically 4 MB in size for virtual machine disks, and spread across so-called placement groups. Where a placement group lives is calculated by the CRUSH algorithm from a map of the cluster. There is no central table in which every block has to be looked up; every participant can work out the location itself. For virtual machines, Ceph provides block devices (RBD, RADOS Block Device) that the guest system sees as an ordinary disk. There is also a file system called CephFS and an S3-compatible object interface.
OSD, MON and MGR: who does what?
A Ceph cluster consists of a few service types with clearly separated tasks:
- OSD (Object Storage Daemon): As a rule, one OSD runs per drive. It stores the data, replicates it to other OSDs and reports its status.
- MON (Monitor): Monitors keep the authoritative map of the cluster, that is, which OSDs are reachable and how data is distributed. They run in odd numbers, usually three or five, and decide by majority.
- MGR (Manager): collects metrics, provides the dashboard and handles management tasks.
- MDS (Metadata Server): only needed for the CephFS file system, not for virtual machine disks.
The majority rule among the monitors prevents two separated parts of the cluster from changing data at the same time and ending up with different states.
How does replication protect your data?
With the usual setting, Ceph stores every object three times. The rules in the CRUSH algorithm make sure the copies sit on different servers, and in larger installations in different racks as well. A write only counts as complete once all active copies have confirmed it. So there is never a moment when only one copy holds the latest state. The price is capacity: with triple replication, 300 TB of raw storage, for example, leaves only around 100 TB usable. Alternatively, Ceph supports erasure coding, which works with parity data much like RAID 6. It needs less space but costs more processing power and is slower for small writes.
What happens when a drive or a server fails?
If an OSD stops responding, the other OSDs report it and the monitors mark it as down. Reads and writes continue via the remaining copies, and the virtual machines usually notice nothing. After a configurable waiting time, ten minutes by default, Ceph starts recreating the missing copies on other drives. Many drives work on this in parallel, which is why redundancy is usually restored much faster than with a RAID rebuild onto a single spare disk. If an entire storage server fails, the same process runs for all of its drives. This requires enough free space in the cluster for the new copies. A cluster that is too full cannot heal itself.
Ceph or RAID: what is the difference?
RAID spreads data across several drives inside one server. If the server itself fails, for example because of a faulty mainboard or power supply, the data is unavailable until the repair, even if all drives are intact. Ceph spreads the copies across several servers, so the failure of a device is part of the design. In return, Ceph needs several servers and a fast network between them. Every write goes over this network, so latency is somewhat higher than with a local NVMe SSD. For a single server, RAID remains the right solution. For storage used by many virtual machines on many hosts, Ceph is widespread.
Why does Ceph not replace a backup?
Ceph protects against hardware failure, not against errors in the data itself. If you accidentally delete a directory or malware encrypts your files, Ceph reliably writes that change to every copy. Snapshots help in some of these cases, but they sit in the same cluster. A backup therefore belongs somewhere separate from the production system, ideally at another location and with several versions.
At Realtoxmedia, VPS, VDS, Cloud Server and Storage VPS all live in the Ceph cluster, with the HDD capacity of the Storage VPS sitting behind an NVMe cache. If a drive or a storage node fails, the data is preserved. That does not replace a backup of your own. Dedicated servers, by contrast, use hardware RAID.
Ceph spreads virtual machine disks as multiple copies across many servers and restores redundancy by itself after a failure. Your server is then no longer tied to a single drive or host. It does not help against deleted or encrypted data, so you still need a separate backup.