system ha
Use this command to configure the FortiMail unit to work in an high availability (HA) cluster or to put the cluster in an HA group in order to increase processing capacity or availability.
Alternatively, to automatically configure most HA settings on secondary units, you can instead use exec ha hb join
.
For deployment topology diagrams and other details, see the FortiMail Administration Guide.
Syntax
config system ha
set mode {active-active | active-passive}
set hb-lost-threshold <seconds_int>
set remote-services-as-heartbeat {enable | disable}
set mail-data-sync {enable | disable}
set mailqueue-data-sync {enable | disable}
edit <group_name>
[set comment "<comment_str>"]
set mode {active-active | active-passive}
set role {primary | secondary}
set primary-backup {enable | disable}
next
end
edit <member_name>
[set comment "<comment_str>"]
set role {primary | secondary}
set primary-backup {enable | disable}
next
end
edit <interface_name>
set heartbeat-status {enable | disable}
set port-monitor {enable | disable}
set add-to-bridge {enable | disable}
set virtual-ip <vip_ipv4/mask>
set virtual-ip6 <vip_ipv6mask>
set virtual-hostname <hostname_str>
next
end
set check-interval <seconds_int>
set check-interval <seconds_int>
next
set check-interval <seconds_int>
set check-timeout <seconds_int>
next
set check-interval <seconds_int>
set check-timeout <seconds_int>
next
set check-interval <seconds_int>
set check-timeout <seconds_int>
next
set check-interval <seconds_int>
set check-timeout <seconds_int>
next
end
set action-on-failure {off | become-secondary | restore-role}
end
Variable |
Description |
Default |
Enter the name for the HA cluster. Group HA settings are used only if type {group | member} is |
|
|
Enter the name of the network interface. |
|
|
Enter the name for the FortiMail unit in the HA cluster. By default, the first entry's name is the hostname of this FortiMail unit. |
|
|
Select what the primary unit will do after it fails (if it can recover), either:
This setting applies only if role {primary | secondary} is See also the HA mode details and examples in the FortiMail Administration Guide. |
|
|
Enable to include the network interface in the bridge. This setting is available only if operation-mode {gateway | server | transparent} is |
disable |
|
Enter the amount of time in seconds between each try. |
120 |
|
Enter the amount of time in seconds to wait for a response when service monitoring tries to connect. |
30 |
|
Enter the name of the HA cluster to identify its log messages when multiple clusters send their logs to the same FortiAnalyzer unit. |
|
|
Enter a comment or description. |
|
|
Select which HA group to join. This setting is available only if type {group | member} is |
|
|
Enter the first of multiple port numbers (see required TCP/UDP open port numbers in the FortiMail Administration Guide) that will be used for:
Note:In addition to a lost heartbeat, other unresponsive network services and hardware failure can also be used to trigger failover. See config service and the HA heartbeat and synchronization details in the FortiMail Administration Guide. |
20000 |
|
Enter the amount of time, in seconds, that a primary unit can be unresponsive until HA detects a failure and performs the action in action-on-failure {off | become-secondary | restore-role}. Caution: If you have service level agreements (SLA), then you may be required to keep this time short. If the failure detection time is too long, email delivery could be delayed or fail until HA detects the failure. This reduces service uptime. Tip: To determine the best heartbeat threshold, monitor your FortiMail unit's performance. Examine how long each high system resource usage lasts. Configure a threshold that is longer than most peak usage. This gives the secondary unit enough time to accurately confirm unresponsiveness, and avoid unnecessary failovers. (Heartbeat responses may be slow during peak load.) To monitor performance, you can use the dashboard in the GUI, system ha, or the CLI: diagnose sys top delay 1 lines 10 |
120 |
|
Enable if this network interface will listen for HA heartbeat and synchronization communications. Note: You must enable this option on at least one of the heartbeat interfaces that you defined for the unit in ip <interface_ipv4mask> and/or ipv6 <interface_ipv6mask> . Otherwise HA will detect a failure. Note:Don't disconnect the heartbeat link once HA is enabled. If the heartbeat is accidentally interrupted for active-passive HA mode, such as when a network cable is temporarily disconnected, the secondary unit will assume that the primary unit has failed, and become the new primary unit. If no failure has actually occurred, both FortiMail units will be operating as primary units at the same time. This can cause an IP address conflict. In active-active HA, this can disrupt configuration synchronization. Tip: For better heartbeat reliability, create two heartbeat links: a primary and a secondary. Directly link the pair of heartbeat ports with an Ethernet crossover cable, or connect them through a dedicated local switch that is not connected to your overall network. This ensures enough bandwidth and low latency for the synchronization and heartbeat. If the heartbeat is interrupted, then a failover may occur. See the HA heartbeat and synchronization details in the FortiMail Administration Guide. |
disable |
|
Enter the hostname of the network interface that will listen for the heartbeat and synchronization. Alternatively, to define a heartbeat interface, instead use ipv6 <interface_ipv6mask> or ip <interface_ipv4mask>. Note: You must also bring up and then enable heartbeat-status {enable | disable} on the interface. If it is disabled, but the hostname is configured here, then HA will detect that the heartbeat link has failed. Tip: Use a hostname to define the heartbeat interface (not an IP address) in environments where IP addresses change often, such as with VMs and containers. Heartbeat hostnames might not be the same as the SMTP relay/proxy hostname (hostname <host_str> in mail settings) and virtual hostname for active-passive HA (virtual-hostname <hostname_str>). |
|
|
Enter the IP address of the network interface that will listen for the heartbeat and synchronization. Alternatively, to define a heartbeat interface, instead use ipv6 <interface_ipv6mask> or hostname <hostname_str>. Note: You must also bring up and then enable heartbeat-status {enable | disable} on the interface. If it is disabled, but the IP address is configured here, then HA will detect that the heartbeat link has failed. |
|
|
Enter the IP address of the network interface that will listen for the heartbeat and synchronization. Alternatively, to define a heartbeat interface, instead use ip <interface_ipv4mask> or hostname <hostname_str>. Note: You must also bring up and then enable heartbeat-status {enable | disable} on the interface. If it is disabled, but the IP address is configured here, then HA will detect that the heartbeat link has failed. |
|
|
Enable if the HA cluster does not store its mail data on a NAS server, and you need to use HA communications to synchronize its system quarantine, per-recipient quarantines, email archives, email users’ preferences, and (server mode only) mailboxes. This setting applies only if mode {active-active | active-passive} is Tip: You can manually initiate a data synchronization whenever significant changes occur ( |
enable |
|
Enable if you want to synchronize the mail queue with FortiMail units in the HA cluster. This setting applies only if mode {active-active | active-passive} is Caution: If the primary unit experiences a hardware failure and you cannot restart it, and if this option is disabled, MTA queue directory data could be lost. Note: If you enable this option, it can reduce performance, and is not guaranteed to prevent data loss. Mail queue directories are very dynamic. Many email could be added to the queue between each sync. If you disable this option, data loss might not occur, either. After a failover, when the unit rejoins the cluster, a separate synchronization mechanism occurs. This often restores the mail queue. For details, see HA synchronization details in the FortiMail Administration Guide. |
disable |
|
Select the HA operating mode, either:
See also the HA mode details and examples in the FortiMail Administration Guide. |
off |
|
Enter a password for this HA cluster. Before FortiMail units in the HA cluster synchronize with each other, they verify that they have the same password. This prevents them from accidentally synchronizing with the wrong cluster. Therefore you must enter the same HA password on all of them. |
|
|
Enter the listening port number of the service on the primary unit and (active-active HA only) secondary. See also required TCP/UDP open port numbers in the FortiMail Administration Guide. |
Varies by service (25 for SMTP etc.) |
|
Enable to monitor the network interface for failure. If it fails, a failover occurs. Also configure settings in: |
disable |
|
If mode {active-active | active-passive} is Note: Usually you should have a primary backup. Otherwise configuration synchronization will be interrupted upon failure. See HA heartbeat and synchronization details in the Administration Guide. |
disable |
|
Enable to avoid the action in action-on-failure {off | become-secondary | restore-role} if the heartbeat links (see heartbeat-status {enable | disable}) temporarily fail, but service monitoring detects that the primary unit is still available. Also configure settings in: |
disable |
|
Enter the number of consecutive unsuccessful tries that indicates a failure. |
3 |
|
Select the role of the FortiMail unit in the HA group. Each FortiMail unit's role in the HA cluster is not synchronized because this distinguishes the primary and secondary units. Effects of the role vary by mode {active-active | active-passive}. |
primary |
|
Enable or disable this FortiMail unit to operate as part of an HA cluster. |
disable |
|
Enable or disable service monitoring. Note: This setting does not exist for network interfaces. Instead use port-monitor {enable | disable}. |
disable |
|
Select the type of HA deployment, either:
For example, if you have one data center to protect, you only need one cluster. However if you have two data centers for geographic redundancy, then you can join the clusters together to form an HA group. Depending on your throughput or failover requirements, with group HA, you can mix the HA modes. Each cluster in an HA group has its own HA mode. At the HA group level, there is also an HA mode that defines throughput or failover amongst the clusters. |
member |
|
Enter a virtual IP address and netmask that the primary unit will have on this network interface. Upon failure detection, the secondary will become the new primary and start to use the virtual IP address. For gateway mode and server mode deployments, DNS records should be configured to point to the virtual IP address, not physical IP addresses.See also system interface, and the HA mode details and examples in the FortiMail Administration Guide. This setting is available only if mode {active-active | active-passive} is |
|
|
Enter the virtual IPv6 address and netmask for this interface. This setting is available only if mode {active-active | active-passive} is |
|
|
Enter a virtual hostname. Similar to behavior with virtual-ip <vip_ipv4/mask>, the virtual hostname belongs to the current primary unit. Upon failover, the secondary unit becomes the new primary unit, and so it starts to use the virtual hostname instead. This setting is available only if mode {active-active | active-passive} is |
|