33.4. Ceph Architecture and Deployment
Ceph separates the control plane from the data plane. Monitors maintain the cluster map and the authentication database; managers collect health and capacity and serve the dashboard; OSDs store objects; metadata servers provide the CephFS namespace; and the RADOS Gateway exposes an S3-compatible object service. Clients obtain a map from the monitors, then talk directly to the OSDs that own the objects. There is no single data server to fail over.
33.4.1. Monitors, Managers, OSDs, Placement Groups, and CRUSH
The monitor quorum is the cluster's source of truth. It stores the monitor map, the OSD map, the CRUSH map, the manager map, and the authentication database. A monitor majority must agree before the cluster accepts map changes. Three monitors tolerate one failure; two monitors do not tolerate a failure and are not a high-availability configuration. The monitors use TCP 3300 for the modern messenger (msgr2) and TCP 6789 for the legacy v1 protocol.
The manager is not in the client I/O path. It aggregates health, capacity, and performance data, runs modules such as the dashboard and the PG autoscaler, and exposes the orchestrator interface. An active manager and a standby are enough for a small cluster.
An OSD owns one storage device and runs the BlueStore object store. It stores objects, serves client reads and writes, participates in replication, and performs scrubbing. The OSD map tells clients which OSDs hold which placement groups. A Ceph cluster needs at least three OSDs on three failure domains for three-way replication.
A placement group (PG) is a logical shard of a pool. Every object is hashed to one PG, and the PG is mapped to a set of OSDs. Replication, recovery, backfill, and scrubbing operate on PGs, not on individual objects. Too few PGs concentrate load and slow recovery; too many PGs consume memory and CPU on every OSD. A common starting rule is roughly 100 PGs per OSD, rounded to a power of two, but the PG autoscaler can adjust the count when the pool's application is enabled.
CRUSH is the placement algorithm. It takes the pool's rule, the PG identifier, and the CRUSH map of buckets (root, host, rack, row, room) and selects OSDs without a central index. The default replicated rule in this cluster chooses one OSD from each host, so three replicas land on three different hosts. If all three OSDs were on one host, three replicas would not survive that host's failure.
| Daemon | Function | Default ports | Data path? |
|---|---|---|---|
ceph-mon |
cluster map, quorum, authentication | 3300 (msgr2), 6789 (v1) | control only |
ceph-mgr |
health, capacity, dashboard, modules | 6800–7300 | no |
ceph-osd |
object storage, replication, recovery, scrubbing | 6800–7300 | yes |
ceph-mds |
CephFS metadata | 6800–7300 | CephFS metadata |
radosgw |
S3 and Swift object API | 7480 (HTTP) or 443 (TLS) | object gateway |
ceph-volume |
prepares and activates OSD devices | none | deployment tool |
Figure 33.4. Clients use the monitor quorum for maps and authentication, then read and write objects through OSDs. Pools are divided into placement groups, and CRUSH maps each PG to OSDs in separate failure domains.
33.4.2. Selecting an Available Debian-Compatible Release and Deployment Method
Debian 13 ships Ceph 18.2.7, the Reef release. The packages are built from the
same upstream source as other distributions' Reef packages, and the Debian
security archive carries the point updates. The package inventory recorded on
storage1 in section 33.2.1 shows every Ceph daemon package at
18.2.7+ds-1+deb13u1; the running daemons confirm the release:
$ sudo ceph --version
ceph version 18.2.7 (6b0e988052ec84cf2d4a54ff9bbbc5e720b621ad) reef (stable)
On storage1, as john, the cephadm package is also available:
$ apt-cache policy cephadm
cephadm:
Installed: (none)
Candidate: 18.2.7+ds-1+deb13u1
Version table:
18.2.7+ds-1+deb13u1 500
500 https://deb.debian.org/debian trixie/main amd64 Packages
500 https://security.debian.org/debian-security trixie-security/main amd64 Packages
There are two practical deployment methods:
| Method | Strengths | Costs and limits |
|---|---|---|
cephadm |
declarative bootstrap, host and daemon orchestration, rolling upgrades, one tool for monitors, OSDs, MDS, and RGW | requires a container runtime (Podman by default), SSH between hosts, and access to container images; the control plane is itself a daemon to manage |
| Debian packages | native systemd units, no container runtime, package-managed upgrades and security updates, small footprint |
each daemon is configured and started by hand; no orchestrator, no automatic host inventory, more room for inconsistent configuration |
For a new production cluster, cephadm is the better default because it keeps
the daemon inventory, placement, and upgrade order in one place. Choose the
package method when containers are prohibited, the cluster is small and
static, or the site already manages Ceph through configuration management.
This chapter's practice cluster uses packages so that every daemon appears as
a normal systemd unit; the client operations and failure behavior are the
same either way.
33.4.3. Building a Small Multi-Node Storage Cluster
Every Ceph node needs a unique hostname, a synchronized clock, the public network address, and, for replication, a second network that carries OSD traffic. The monitor quorum should have an odd number of members, and each monitor should be on a different host. The practice cluster uses three monitors, three OSDs, and one manager, with the metadata server and gateway on the first storage host.
The [global] section is the shared configuration and is the same on every
node:
[global]
fsid = a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
mon initial members = storage1 storage2 storage3
mon host = 192.168.234.11,192.168.234.12,192.168.234.13
public network = 192.168.234.0/24
cluster network = 192.168.235.0/24
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
osd pool default size = 3
osd pool default min size = 2
osd pool default pg num = 64
osd pool default pgp num = 64
The fsid is generated once with uuidgen and copied to every node; it must
never be regenerated for a running cluster. mon initial members seeds the
first monitor map. mon host tells clients and daemons where the monitors
are. public network carries client traffic and monitor traffic; cluster
network carries OSD replication, recovery, and heartbeats. The two networks
are separate in the practice topology, as Figure 33.1 shows.
The RADOS Gateway section is per-host configuration: it is appended to
/etc/ceph/ceph.conf on storage1 only, and its section name matches the
daemon identity of the ceph-radosgw@rgw.storage1 unit used in
section 33.5.3:
[client.rgw.storage1]
host = storage1
rgw_frontends = beast port=7480
rgw_realm = default
rgw_zonegroup = default
rgw_zone = default
rgw_enable_apis = s3, admin
With cephadm, the first host is bootstrapped with one command. On the first
monitor host, as root, bootstrap the first monitor; the monitor address must
be the host's public address, and a separate cluster network is optional but
recommended:
# apt install cephadm
The install prompts for confirmation. Bootstrap the first monitor:
# cephadm bootstrap --mon-ip 192.168.234.11 --cluster-network 192.168.235.0/24
The bootstrap prints the dashboard URL, the generated client.admin keyring
path, and a command for adding hosts. Record the keyring path and protect it;
it grants full cluster access. On the bootstrap host, as root, add the other
hosts through the orchestrator, then let it place the daemons:
# ceph orch host add storage2 192.168.234.12
# ceph orch host add storage3 192.168.234.13
# ceph orch apply mon --placement="storage1,storage2,storage3"
# ceph orch apply osd --all-available-devices
The orchestrator prints a site-specific summary for each command; the exact
output depends on the host inventory and is not reproduced here. This
subsection is the documented cephadm path: the practice cluster was
assembled with the package method below, so the client, failure, and recovery
procedures later in the chapter are the captured material.
The host add command needs SSH access from the bootstrap host to the new
host. Use the normal host-key verification described in
Chapter 20, or let cephadm install its own key with
ceph cephadm get-pub-key and an explicitly verified authorized_keys entry.
Do not disable host-key checking to make the orchestration noninteractive.
With Debian packages, the daemons are installed and started by hand, and the
first monitor's keyrings and monitor map are created once. Place the
[global] configuration on the first monitor host before starting; the
script below reads fsid from it so the monitor map and the daemon
configuration agree. Replace the example fsid in the file with the value
generated for your cluster. The following is a script, not a terminal
transcript. Save it on the first monitor host and run it as root:
#!/bin/sh
set -e
apt install ceph-mon ceph-mgr ceph-osd ceph-common ceph-volume
FSID=$(awk '/^fsid/ {print $3}' /etc/ceph/ceph.conf)
ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'
ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring \
--gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' \
--cap mds 'allow *' --cap mgr 'allow *'
ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring
monmaptool --create --add storage1 192.168.234.11 --fsid "$FSID" /tmp/monmap
chown ceph:ceph /tmp/ceph.mon.keyring /tmp/monmap
install -d -o ceph -g ceph /var/lib/ceph/mon/ceph-storage1
sudo -u ceph ceph-mon --mkfs -i storage1 --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring
systemctl enable --now ceph-mon@storage1
The keyring commands are silent on success; ceph-mon --mkfs prints progress
as it creates the monitor store. Verify the first monitor before adding the
others; a monitor that cannot form quorum will not accept the later maps. The
additional monitors receive the monitor keyring and the monitor map from the
first monitor, run ceph-mon --mkfs with their own -i name, and start their
ceph-mon@<hostname> unit. The manager is created with
ceph auth get-or-create mgr.storage1 ... and started as
ceph-mgr@storage1.
An OSD is prepared from a whole disk or a logical volume: ceph-volume
creates the BlueStore metadata and data layout, registers the OSD with the
cluster, and enables the unit that starts it at boot. On an OSD host, as
root, prepare an OSD from a whole disk or a logical volume:
# ceph-volume lvm create --data /dev/vdd
The command prints each preparation step and ends with
ceph-volume lvm create successful for: <device>; section 33.5.5 shows a
complete captured run on a replacement device. It is safe to run on a
disposable device only; it destroys existing signatures. The OSD joins the
CRUSH map as a host child and begins receiving placement groups once the pool
rules place data there.
On storage1, as root, check the resulting monitor map and CRUSH topology:
# ceph mon dump
epoch 1
fsid a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
last_changed 2026-11-25T22:07:52.360201+0000
created 2026-11-25T22:07:52.360201+0000
min_mon_release 18 (reef)
election_strategy: 1
0: v1:192.168.234.11:6789/0 mon.storage1
1: v1:192.168.234.12:6789/0 mon.storage2
2: v1:192.168.234.13:6789/0 mon.storage3
dumped monmap epoch 1
The v1: prefix is the legacy messenger. A production cluster should also
enable msgr2 so clients can use the encrypted, multiplexed protocol. On
storage1, as root, enable the modern messenger with:
# ceph mon enable-msgr2
The command updates the monitor bindings. Verify with ceph mon dump, which
should show a v2: address in addition to v1:, and clear the
MON_MSGR2_NOT_ENABLED warning once the monitors bind TCP 3300 on the public
network. A cluster that leaves the legacy port enabled still serves clients,
but ceph -s reports the warning until the modern messenger is enabled.
33.4.4. Pools, Replication Policy, Placement, and Failure Domains
A pool is the unit of replication and placement. On storage1, as root, the
rbdpool used for block images has three replicas, a minimum of two replicas
for I/O, and 32 placement groups in this small cluster:
# ceph osd pool get rbdpool size
size: 3
# ceph osd pool get rbdpool min_size
min_size: 2
size 3 means three copies. min_size 2 means the pool accepts writes while
at least two copies are available; with only one copy, I/O stops rather than
silently risking data loss. The two values are a policy choice, not a
performance tuning knob. Raising min_size to 3 makes the pool read-only
during any single-OSD outage; lowering it to 1 lets writes continue with no
redundancy. The default of 2 is a compromise that preserves availability
during one failure while refusing to write into a fully degraded pool.
On storage1, as root, the CRUSH tree shows the failure domains the rule can choose:
# ceph osd crush tree
ID CLASS WEIGHT TYPE NAME
-1 0.00568 root default
-3 0.00189 host storage1
0 hdd 0.00189 osd.0
-5 0.00189 host storage2
1 hdd 0.00189 osd.1
-7 0.00189 host storage3
2 hdd 0.00189 osd.2
The default replicated rule uses chooseleaf firstn 0 type host: for each PG
it chooses a host, then an OSD within that host. With three hosts and
size 3, the three replicas land on three different hosts. If the cluster
grew to six OSDs on three hosts, the rule would still place at most one
replica per host, so a host failure would remove exactly one replica. To
survive a rack failure, the CRUSH map needs rack buckets and a rule that
chooses by rack; host-level placement alone cannot do it.
On storage1, as root, create a pool with an explicit application so Ceph
can select the right defaults and the PG autoscaler can work:
# ceph osd pool create handbook-pool 32 32
# ceph osd pool application enable handbook-pool rbd
# ceph osd pool set handbook-pool size 3
# ceph osd pool set handbook-pool min_size 2
The pool commands may print a one-line confirmation; verify the result with
ceph osd pool get. The create command needs the two PG numbers; the later
commands change policy on the existing pool.
The first two numbers are pg_num and pgp_num; keep them equal unless you
are deliberately splitting PGs. The application name (rbd, cephfs, or
rgw) lets Ceph apply pool-specific defaults and clear the
POOL_APP_NOT_ENABLED warning. The PG autoscaler can change the count later
when the pool's usage justifies it. The practice cluster's rbdpool was
created this way during deployment; the block and RADOS exercises in
section 33.5 use it.
33.4.5. Separating Management, Client, and Replication Traffic
Ceph has three traffic classes that benefit from separation:
- Client traffic (RBD, CephFS, RGW) goes to the public network. It is latency-sensitive and should not compete with recovery.
- Monitor and manager traffic is small but critical; losing it loses quorum. Keep it on a reliable network with a bounded round-trip time.
- OSD replication, heartbeat, and recovery goes to the cluster network. It is bandwidth-heavy and bursty, especially during backfill.
The public network and cluster network settings in ceph.conf implement
the split. mon host lists the public addresses that clients use. If the
cluster network is omitted, Ceph uses the public network for everything,
which is acceptable for a small lab but leaves recovery competing with client
I/O on a production cluster.
The ports to permit through a host firewall are:
| Traffic | Ports | Notes |
|---|---|---|
| Monitor msgr2 | TCP 3300 | preferred client and daemon messenger |
| Monitor v1 | TCP 6789 | legacy messenger; monitors keep listening here after msgr2 is enabled, for pre-msgr2 clients |
| OSD, MDS, manager | TCP 6800–7300 | daemon-to-daemon and client data |
| RADOS Gateway | TCP 7480 (HTTP) or 443 (TLS) | S3 and Swift endpoint |
cephadm SSH |
TCP 22 | only between orchestration hosts; not needed for clients |
Do not expose the monitor or OSD ports to an untrusted network. Ceph's authentication protects the protocol, but the daemons are not designed to be Internet-facing. Put the public network on a private address range and use the gateway or a reverse proxy for object clients that must cross a trust boundary.