Back openDesk Edu for a sovereign, open-source education â every vote counts.
Vote nowSave products you love by clicking the heart icon.
CephFS in production: MDS architecture, pool design, quotas, snapshots, subvolume groups, multi-MDS scaling, Kubernetes CSI, and operations.
Teaser: Ceph ist das Storage-Backbone hinter OpenStack, dem Sovereign Cloud Stack und tausenden selbstgehosteten Clustern â dennoch behandeln die meisten Engineers es wie eine Blackbox. Dieser Deep Dive analysiert den RADOS Object Store, das On-Disk-Design von BlueStore und das CRUSH-Placement, damit Sie einen Cluster mit Zuversicht designen, deployen und debuggen können â einschlieĂlich der Ănderungen, die Squid 19.2 und das kommende Tentacle 20.2 fĂŒr den Produktiveinsatz mit sich bringen.
Ceph verwandelt eine Ansammlung von Commodity-Disks in einen elastischen Storage-Pool mit drei Protokollen: RBD (Block), RGW (S3-kompatible Objekte) und CephFS (POSIX-Dateisystem). Der Clou ist, dass alle drei lediglich dĂŒnne Frontends ĂŒber demselben verteilten Object Store, RADOS, sind. Wenn Sie RADOS verstehen, verstehen Sie Ceph â und 90 % der AusfĂ€lle in der Produktion werden vorhersehbar.
RADOS (Reliable Autonomic Distributed Object Store) ist ein selbstheilender, selbstverwaltender Key-Value Object Store. Jedes Objekt wird durch einen 128-Bit-Namen identifiziert, und Objekte befinden sich in Pools, die Replikation, Erasure Coding und Placement-Regeln definieren.
Die entscheidende Design-Entscheidung: Clients berechnen das Data Placement selbst. Es gibt keinen zentralen Metadaten-Server im I/O-Pfad. Ein Client nimmt einen Objektnamen, hasht diesen in eine Placement Group (PG) und fragt den CRUSH-Algorithmus, welche OSDs diese PG halten sollten. Aus diesem Grund skaliert Ceph linear â die OSDs sind die einzigen Komponenten, die Daten bewegen, und die Cluster-Map ist der einzige gemeinsame Status.
Jeder Client und jeder Daemon hÀlt eine Kopie der Cluster-Map, die wie eine verteilte Datenbank versioniert wird. Sie enthÀlt:
Wenn sich eine dieser Maps Ă€ndert, erhöht sich die Map-Epoch und die Ănderung wird per Gossip-Protokoll verbreitet. Veraltete Maps sind die Hauptursache fĂŒr die meisten VorfĂ€lle mit âmisdirected I/Oâ und âslow requestsâ â weshalb das Tuning der Monitore und die ceph osd pool application-Hygiene wichtiger sind als der reine Durchsatz.
Ein Pool ist der Ort, an dem die Policies definiert werden:
size=3, min_size=2. Einfach, geringe CPU-Last, höherer Speicherbedarf.CRUSH (Controlled Replication Under Scalable Hashing) ist das, was Ceph von jedem System mit einem Metadaten-Broker unterscheidet. Es ist eine deterministische pseudo-zufĂ€llige Funktion ĂŒber:
CRUSH(object, PG, cluster_map, rule) â ordered list of OSDs
Die Rule kodiert Ihre Failure-Domain-Policy. Eine gĂ€ngige Regel: âWĂ€hle 3 verschiedene Hosts, dann 1 OSD pro Hostâ â dies garantiert, dass ein Host-Ausfall niemals alle Replikate eines Objekts vernichtet.
Die Bucketing-Hierarchie ist die physische RealitĂ€t, die Sie kodieren: root â datacenter â room â row â rack â host â OSD. Jeder Bucket hat ein Gewicht; OSD-Gewichte sind proportional zur Disk-KapazitĂ€t (eine 4-TB-OSD wiegt 4-mal so viel wie eine 1-TB-OSD).
Hier scheitern viele Produktionscluster: CRUSH-Gewichte beschreiben die Zielverteilung, nicht die aktuelle Nutzung. Wenn Sie eine neue OSD hinzufĂŒgen, rebalanciert CRUSH einen Teil der PGs darauf, aber die Menge hĂ€ngt vom Gewicht und der PG-Anzahl ab â und ist pro PG-Movement begrenzt. Das balancer-Modul (seit Pacific standardmĂ€Ăig aktiviert) gewichtet und optimiert periodisch neu, aber bei groĂen Clustern sollten Sie dennoch:
ceph pg dump prĂŒfen Sie, ob pg_num pro Pool eine Zweierpotenz ist)osd_crush_update_on_start: true verwenden und osd_recovery_max_active fĂŒr ein kontrolliertes Backfill tunenrecovery_rate ĂŒberwachen und die Recovery wĂ€hrend der GeschĂ€ftszeiten drosselnSeit Luminous ĂŒbernimmt BlueStore den Datenpfad. Es ersetzt das alte FileStore (ein POSIX-Dateisystem auf einem Dateisystem) durch ein direktes Block-Device-Layout:
Diese Trennung von âFast Device fĂŒr Metadaten, groĂe HDDs fĂŒr Datenâ ist der Grund, warum Ceph-HDD-Cluster weitaus besser performen, als man erwarten wĂŒrde: Der Hot Path der Metadaten liegt auf SSD/NVMe, wĂ€hrend die Massendaten auf die Disks streamen.
Squid (v19.2.x), veröffentlicht am 26. September 2024, ist die aktuelle Long-Term-Stable-Serie. Die Release Notes heben hervor:
rbd-wnbd Multiplexing â ein Daemon pro Windows-Host statt eines pro Image.ceph tell --daemon-output-file â Streaming groĂer Command-Outputs in eine daemon-lokale Datei, um Memory-Spikes bei den Monitoren zu vermeiden.Seit Octopus ist cephadm (containerisiert, systemd-verwaltet, SSH-orchestriert) der unterstĂŒtzte Deployment-Pfad. Manuelle ceph-deploy-Cluster sind Legacy. Wichtige Operationen:
# Bootstrap eines Single-Node-Clusters (erkennt den Host, deployt MON+MGR+OSD)
cephadm bootstrap --mon-ip 192.168.42.10
# HinzufĂŒgen einer OSD auf einem spezifischen Device
ceph orch device zap <host> /dev/sdb --force
ceph orch daemon add osd <host>:/dev/sdb
# Deployment von RGW mit einem Realm+Zone (spĂ€ter fĂŒr Multisite benötigt)
ceph orch apply rgw rgw.site1 --placement "3 host1 host2 host3" --port 7480
ceph fs volume create cephfs --placement="2 host1 host2"
ceph orch apply nvmeof nvmeof.gw1 --placement "2 host1 host2"
The `ceph orch` layer manages **daemon placement as a desired state**, which is the single biggest quality-of-life improvement in Ceph history: no more hand-edited systemd units or manual config distribution.
### Upgrade Discipline
Ceph requires **upgrading one daemon type at a time**, in order: MONs first, then MGR, then OSDs (by default), then MDS/RGW/clients. `ceph orch upgrade start --image quay.io/ceph/ceph:v19.2.5` handles it, but verify:
- `ceph versions` â all daemons on the same version before proceeding
- `ceph health detail` â no `PG_AVAILABILITY` or `OSD_*` warnings
- Back up the `ceph.conf`, client keys, and the MON store before starting
## Day-2 Operations: The Metrics That Predict Outages
The MGR hosts the Prometheus endpoint (`<mgr-ip>:9283/metrics`). The alerts that actually catch real incidents:
| Metric | Threshold | What it means |
| ------------------------------- | --------------- | --------------------------------------- |
| `ceph_osd_down` | > 0 for > 5 min | OSD crash or network partition |
| `ceph_pg_inactive` | > 0 | PGs stuck â data unavailable |
| `ceph_pg_degraded` | > 0 persistent | Replicas missing, recovery stuck |
| `ceph_osd_apply_latency` | > 1s | Slow OSD â often disk or network issue |
| `ceph_osd_commit_latency` | > 1s | fsync path saturated |
| `ceph_cluster_total_used_bytes` | > 85% | Full cluster â recovery/backfill stalls |
| `ceph_mon_quorum` | < 3 | Quorum loss = cluster unavailable |
**The "full" cliff is non-linear.** Ceph blocks writes at `mon_osd_full_ratio` (default 0.95) but degrades _much_ earlier: recovery and rebalancing slow down as free space shrinks, and `nearfull` warnings (0.85) should trigger a capacity plan, not a "wait and see".
## RBD, RGW, and CephFS in Production
### RBD (Block)
The bread and butter for OpenStack/K8s. Key concepts: **image** (thin-provisioned block device), **snapshot** (instant, copy-on-write), **clone** (snapshot-based COW image), and **rbd-mirror** (async replication to a second cluster â the standard DR pattern, with a journal or snapshot-based sync).
Squid's `diff-iterate` improvement makes QEMU live disk sync dramatically faster â this is what powers consistent VM backups without agent-in-VM.
### RGW (Object / S3)
The S3 gateway runs as a stateless frontend over RADOS. For production:
- **Multisite** requires realm â zonegroup â zone structure; one zone per site, sync agents replicate buckets asynchronously
- The Squid fix for the `RGWBucketFullSyncCR` infinite loop (source bucket deleted mid-sync) matters if you do active bucket deletions across sites
- **IAM user accounts** (Squid) replace the legacy S3-style key management for self-service tenants
- TLS 1.3 ciphersuites config (`ssl_ciphersuites`) for the Beast frontend
### CephFS (File)
MDS is the metadata service; **one active MDS per filesystem** is the normal mode, with standbys for failover. Squid's **quiesce API** is the notable new tool: pause I/O on a subtree so distributed apps get crash-consistent snapshots â think databases or job queues on CephFS.
## What Tentacle (v20.2) Brings â Released 2026
**Tentacle is the 20th stable release** (v20.2.2, June 16, 2026). The headline features for operators:
- **Native SMB support** â a new `smb` MGR module deploys Samba-backed SMB shares on CephFS, with CTDB clustering and a `cephfs-proxy` daemon for scale. This finally makes Ceph a credible replacement for Windows file servers and NAS appliances.
- **CephFS case-insensitive / normalized directory entries** â configurable per-directory
- **NVMe/TCP gateway groups and multiple namespaces** â dashboard-managed, with DHCHAP controller keys, namespace encryption, and secure listeners
- **Dashboard overhaul** â multi-cluster management, OAuth 2.0, RGW multisite automation, tiering, notifications, granular replication policy
- **Fast EC restrictions** â non-4K-aligned EC chunk sizes are rejected, closing a class of silent performance bugs
- **NVMeoF fast failover** â beacon grace reduced from 10s to 7s
- **Rocky 10 package-based installs** supported from v20.2.2
For the digital-sovereignty crowd this matters: Ceph + OSISM remains the reference backend for the **Sovereign Cloud Stack**, and the SMB/NVMeoF work widens the "leave the hyperscaler" envelope considerably.
## Design Checklist for a New Cluster
1. **Failure domains**: encode racks (`crush rule` with `rack` as failure domain) or accept host-level only. Never put 3 replicas on one host.
2. **Network separation**: a dedicated **cluster network** for OSDâOSD replication/backfill; public network for clients. One 10GbE NIC for both is a latency accident waiting to happen.
3. **PG sizing**: total PGs â `(OSDs Ă 100) / replication_factor`, spread across pools as powers of two. `pg_autoscaler` (default on) helps, but set `target_size_ratio` per pool.
4. **BlueStore fast devices**: give every OSD an NVMe/SSD for `block.db`/`block.wal` if you can't afford all-flash â it's the highest-ROI upgrade for HDD clusters.
5. **Monitors**: odd count, min 3, on separate hosts, **never** alongside heavy OSDs or in the same failure domain. `mon_clock_drift` warnings mean NTP is broken.
6. **Capacity discipline**: alert at 70% used, plan at 80%, panic at 85%. Autoscaler plus `ceph osd reweight-by-utilization` are your friends.
7. **Auth**: CephX everywhere; rotate client keys; scope keys per tenant/application (`mon caps`, `osd caps`, `mgr caps`).
8. **Backup**: RBD images â `rbd export` or mirroring; RGW â bucket replication or `s3 sync` to another cluster; CephFS â snapshots + `cephfs-mirror` (since Pacific).
## Debugging in the Trenches
```bash
# Die drei Befehle, die 90 % der Fragen beantworten
ceph health detail
ceph pg dump_stuck inactive,unclean,undersized
ceph osd tree # + ceph osd perf fĂŒr Latenzen pro OSD
# Langsame Anfragen â wo bleibt die Zeit hĂ€ngen?
ceph daemon osd.<id> dump_historic_ops
ceph daemon osd.<id> dump_ops_in_flight
# Erledigt der Balancer seinen Job?
ceph balancer status
ceph osd df tree
# Inspektion der CRUSH-Map
ceph osd crush rule dump
ceph osd crush tree
Wenn eine OSD langsam ist, prĂŒfen Sie in dieser Reihenfolge: Disk-Health (smartctl), BlueStore-Compaction (ceph daemon osd.N compact), SĂ€ttigung des RocksDB-WAL-Devices und schlieĂlich das Cluster-Netzwerk â ceph osd perf plus dump_ops_in_flight helfen dabei, eine sterbende Festplatte von einer gesĂ€ttigten NIC zu unterscheiden.
Ceph belohnt den Engineer, der seine eine groĂe Kernidee versteht: Placement ohne Koordination. Beherrschen Sie die Cluster-Map, die CRUSH-Rule und das Device-Layout von BlueStore, und der Rest ist operational Hygiene â die richtigen Metriken ĂŒberwachen, die Recovery drosseln und den Full-Ratio-Cliff respektieren. Mit dem stabilen Release von Squid und den SMB- sowie NVMeoF-Optimierungen in Tentacle gab es noch nie einen besseren Zeitpunkt, den eigenen Storage im eigenen Rechenzentrum zu betreiben.