Knowledge base

Switching over to a standby node

High Availability Configuration
The spool moves along with the work

A two-node scheme: when the primary fails, the submitting program sends new mail to the standby. If the failed node’s spool can be recovered, it is attached to the standby as a second spool and the service is restarted — the standby sends both new and old mail.

Failback is in reverse order. New mail is returned to the recovered primary node, while the standby keeps working until the recovered mail is delivered or bounced; then it gets its single spool back and stays idle until next time.

The main trap is shutting down the standby right after failback. It is the one delivering mail from the attached spool: stopping it before that mail is delivered or bounced leaves the mail undelivered on disk.
What the Hub does. 🔴 The Hub has no notion of a standby node: nodes are independent, and the messages queued on a failed one exist nowhere else. Moving the spool is the only way not to lose them, and it is done by hand.
Recommended values

Who does what at each stage:

Stage Primary node Standby node
failure down new mail and, if the spool was saved, old mail as a second spool
failback new mail finishes sending the recovered mail
after that new mail one spool, idle
The failover and failback order come from the manual (§ 11.11); the second spool and delivery-only mode are § 3.3.2. The table is ours.
Example configuration
<spool /var/spool/pmta>
</spool>
<spool /mnt/failed-node/spool>
    deliver-only true</spool>
The path to the failed node’s spool is for illustration; deliver-only prevents new messages from being placed in it.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Check that the standby node picked up the second spool:
pmta show status
The Spool and Queues lines after the restart should grow by the failed node’s files and recipients.
In the Hub
Cost of a mistake
disruptive: applying it interrupts the node
Scenarios
Emergency stop · High availability