Ceph MON_NETSPLIT health warning: what to check and fix
Ceph MON_NETSPLIT means monitors lost contact. It needs 3+ monitors and the connectivity election strategy. Find the pair and repair the network path.
[WRN] MON_NETSPLIT: 1 network partition detected Netsplit detected between mon.a and mon.dMON_NETSPLIT means a network partition exists among Ceph monitors, and the fix is to repair the network path between the pair or locations named in the warning. The block above puts the strings from the v20.2.5 source into ceph health detail form ([HealthMonitor.cc L1219-L1247](https://github.com/ceph/ceph/blob/v20.2.5/src/mon/HealthMonitor.cc#L1219-L1247)). A location-level split reads Netsplit detected between dc1 and dc2 on the second line.
The documented condition is **at least three monitors plus the connectivity election strategy** (health checks · MON_NETSPLIT, source L982-L990). The default strategy is classic.
[1] Check quorum and the election strategy. All of these are read-only.
$ ceph health detail$ ceph quorum_status$ ceph mon dumpIn ceph mon dump, election_strategy: is 1 classic, 2 disallow, or 3 connectivity. The stretch_mode_enabled line in the same output shows whether stretch mode is on. The MON_NETSPLIT section does not discuss quorum risk. Monitors answer a status request only when a quorum has formed (Troubleshooting Monitors), so a reply means a quorum existed at that moment. That does not make the cluster safe.
[2] Use the warnings shown alongside it to sort out the situation. The source reports monitors outside quorum as MON_DOWN and leaves them out of netsplit detection (L841-L865). The pair test is narrow too: neither side may have a connection toward the other, and each must still have an incoming connection from some other monitor ([ConnectionTracker.cc L398-L422](https://github.com/ceph/ceph/blob/v20.2.5/src/mon/ConnectionTracker.cc#L398-L422)).
| What you see | Meaning |
|---|---|
MON_NETSPLIT alone, monitor pair | A connection problem between those two monitors |
MON_NETSPLIT alone, location pair | Every monitor in one location lost every monitor in the other |
MON_DOWN as well | A monitor left quorum. It will not appear in the netsplit lines |
MON_NETSPLIT gone, MON_DOWN appeared | Possibly worse, not recovered. A cut-off monitor that leaves quorum drops out of detection |
Location names come from crush_location in ceph mon dump. A monitor with no location always shows up as a monitor pair (L1108-L1113).
[3] Read the connection scores on each monitor. This is read-only and runs against the admin socket on that monitor's host.
# ceph daemon mon.a connection scores dumpOn cephadm deployments, enter the daemon container and name the socket (cephadm troubleshooting).
# cephadm enter --name mon.a# ceph --admin-daemon /var/run/ceph/ceph-mon.a.asok connection scores dumpScores run from 0 to 1 and come with whether the connection is alive or dead (Examining connectivity scores). The docs do not recommend connection scores reset unless your support team or a developer advises it. Leave it alone.
[4] Test the monitor ports in both directions from the two hosts in the pair. The docs say to connect from each monitor node to the others on tcp/3300 and tcp/6789.
$ nc -zv 192.0.2.11 3300$ nc -zv 192.0.2.11 6789The example the docs give is leftover iptables rules from earlier testing. Take the target addresses from ceph mon dump.
[5] Fix the network cause you found: firewall rules, switches, links, or routes.
[6] Confirm the warning clears. Check ceph health detail, then use ceph quorum_status to confirm every monitor is in quorum.
[7] Decide on anything that only hides the warning after the cause is fixed. Start with the grace period, which filters short drops on the releases in the table below.
$ ceph config help mon_netsplit_grace_period$ ceph config get mon mon_netsplit_grace_period| Release (tagged source) | MON_NETSPLIT | mon_netsplit_grace_period |
|---|---|---|
| Reef v18.2.7, Squid v19.2.3 | No | No |
| Squid v19.2.4, v19.2.5 | Yes | No (reported with no grace) |
| Squid v19.2.6, v19.2.7 | Yes | Yes (default 9 seconds) |
| Tentacle v20.2.0 to v20.2.3 | Yes | No (reported with no grace) |
| Tentacle v20.2.4, v20.2.5 | Yes | Yes (default 9 seconds) |
The Tentacle docs state a 9-second default without separating releases, but [mon.yaml.in at v20.2.0](https://github.com/ceph/ceph/blob/v20.2.0/src/common/options/mon.yaml.in) has no such option. The v20.2.5 release note about reverting the "netsplit grace period change" (pr#71847) covers messenger commits only, as the PR title says. The option is still in the v20.2.5 source.
Before changing the grace period, record whether a stored value exists. ceph config get falls back to the default when nothing is stored, so check ceph config dump instead (Ceph configuration). Quorum is not affected, only when the warning appears. A higher value keeps shorter partitions out of health output.
$ ceph config dump | grep mon_netsplit_grace_period# ceph config set mon mon_netsplit_grace_period 30To revert, set the recorded value back if a mon entry existed. Remove the entry only if there was none.
# ceph config set mon mon_netsplit_grace_period <recorded-value># ceph config rm mon mon_netsplit_grace_periodTo hide it during maintenance, mute it for a set time (Muting health checks). The partition itself stays.
# ceph health mute MON_NETSPLIT 1h# ceph health unmute MON_NETSPLITFor other codes see ceph health detail: read the output and HEALTH_WARN codes, and for monitor clocks see Fix Ceph MON_CLOCK_SKEW "clock skew detected on mon".