CephCX · Monitor RecoveryMonitor Recovery
Moving a monitor to a different address
What you'll learn
- Explain why the monmap holds addresses rather than names
- Move a monitor by removing and re-adding it
- Change monitor addresses in place with monmaptool
- Identify everything else that must be told about the change
Prerequisites
None — start here.
Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18
Why this matters in production
A monitor is located by the address in the monmap, not by its name, so a host renumbering that nobody propagated leaves a monitor the cluster cannot find and clients that fail only when they next start.
Addresses, not names
ceph mon dump | grep -E '^[0-9]+:'
0: [v2:10.0.1.11:3300/0,v1:10.0.1.11:6789/0] mon.ceph-a
1: [v2:10.0.1.12:3300/0,v1:10.0.1.12:6789/0] mon.ceph-b
| Name resolution point | Used for |
|---|---|
mon_host in ceph.conf | bootstrap only — finding any live monitor once |
mon_dns_srv_name SRV records | an alternative bootstrap source |
| The monmap addrvec | every connection after bootstrap |
| The monitor name | identity in commands, never for lookup |
The safe path: remove, renumber, re-add
With quorum intact this needs no downtime and no map surgery.
ceph mon ok-to-stop ceph-b
ceph orch daemon rm mon.ceph-b --force
ceph mon dump | grep -E '^[0-9]+:' # confirm it is gone
# renumber the host, then let cephadm rebuild the monitor there
ceph orch apply mon --placement="ceph-a,ceph-b,ceph-c"
ceph orch ps --daemon-type mon --refresh
# a single address correction while the monitor is otherwise fine
ceph mon set-addrs ceph-b '[v2:10.0.2.12:3300,v1:10.0.2.12:6789]'
ceph mon dump | grep ceph-b
Changing every address at once
When the whole cluster moves subnet there is no live quorum to work through, so the map is edited offline and injected into each monitor.
# take the map while the cluster is still up
ceph mon getmap -o /tmp/monmap
monmaptool --print /tmp/monmap
for m in ceph-a ceph-b ceph-c; do
monmaptool --rm "$m" /tmp/monmap
done
monmaptool --addv ceph-a '[v2:10.0.2.11:3300,v1:10.0.2.11:6789]' /tmp/monmap
monmaptool --addv ceph-b '[v2:10.0.2.12:3300,v1:10.0.2.12:6789]' /tmp/monmap
monmaptool --addv ceph-c '[v2:10.0.2.13:3300,v1:10.0.2.13:6789]' /tmp/monmap
monmaptool --print /tmp/monmap
# stop every monitor first, then on each host with its own id
sudo -u ceph ceph-mon -i ceph-a --inject-monmap /tmp/monmap
sudo -u ceph ceph-mon -i ceph-a --public-addr 10.0.2.11
Injecting into a subset produces two disjoint views of the monitor set
and no quorum at all. Stop all of them, inject into all of them.
Everything else that has to be told
| Consumer | Where the address lives |
|---|---|
| New Ceph clients | mon_host in /etc/ceph/ceph.conf |
| cephadm-managed hosts | the conf cephadm regenerates from the monmap |
| Kubernetes CSI | the cluster ConfigMap and secrets holding monitor addresses |
| RGW, NFS, iSCSI gateways | their own ceph.conf |
| Firewalls | TCP 3300 and 6789 on the new subnet |
| Monitoring and dashboards | scrape targets and any hard-coded endpoints |
Quiz
Knowledge check · 4 questions
Q1. What is `mon_host` in `ceph.conf` actually used for?
Q2. After a monitor changes address, already-running clients keep working with no configuration change.
Q3. Move a Ceph cluster to a new subnet.
All three monitors must move from 10.0.1.0/24 to 10.0.2.0/24 in a single maintenance window. Clients include RBD consumers, a CephFS CSI driver, and two RGW gateways.
Q4. Why is the monitor name not used to locate a monitor?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Prefer removing and re-adding a monitor over editing its address, and reserve monmap injection for the case where the whole set moves at once — then stop every monitor before injecting into any of them. Push client configuration in the same window as the renumbering; the client breakage otherwise arrives hours later and looks like something else.
Cross-course references
- Kubernetes: a Service endpoint change propagates to running pods and strands only newly scheduled ones
- Linux: bootstrap configuration that is never validated drifts silently until the next restart