FOC Connection Manager configuration parameter

The FOC parameter and attributes specify the failover configuration for high-availability clusters, and specify the priority of the connection between the Connection Manager and the primary server.

Read syntax diagramSkip visual syntax diagram
Syntax

        .-ORDER=ENABLED--.                   
|--FOC--+-ORDER=DISABLED-+--PRIORITY=value---------------------->

>--+-----------------+------------------------------------------|
   '-TIMEOUT=seconds-'   

Attributes of the FOC Connection Manager configuration parameter

The FOC parameter is required by CLUSTER connection units.

Table 1. Attributes of the FOC parameter
Attribute of the FOC parameter Description
ORDER Disables automatic failover or specifies that the value of the primary server's HA_FOC_ORDER configuration parameter is used for automatic failover.

If the ORDER attribute is not specified, the value of the primary server's HA_FOC_ORDER configuration parameter is used for automatic failover.

If the ORDER attribute is not specified, and the primary server's HA_FOC_ORDER configuration parameter is not set, the failover order is SDS, HDR, and then RSS.

PRIORITY Specifies the priority of connections between Connection Managers and the primary server of a cluster.

The value must be a positive integer and unique among all Connection Manager CLUSTER units specified for a high-availability cluster. The lower the number, the higher the priority.

For CLUSTER connection units, a PRIORITY value must be specified, even if ORDER is set to DISABLED.

TIMEOUT Specifies the number of additional seconds the Connection Manager waits for primary-server events before the Connection Manager begins failover processing.

The TIMEOUT attribute value applies after the EVENT_TIMEOUT parameter value is exceeded. For example, if the EVENT_TIMEOUT parameter is set to 60 and the TIMEOUT value is set to 10, 70 seconds of no primary server events must elapse before failover can begin.

If the TIMEOUT attribute is not specified, failover begins immediately after the amount of time that is specified by the EVENT_TIMEOUT parameter value is exceeded.

Values for the ORDER attribute of the FOC Connection Manager configuration parameter

Table 2. Values for the ORDER attribute of the FOC Connection Manager configuration parameter.
ORDER attribute value Description
ENABLED Specifies that the Connection Manager can perform automatic failover. The Connection Manager uses the value of the primary server's onconfig file HA_FOC_ORDER configuration parameter to determine failover sequence.

If the ORDER attribute is set to ENABLED, but the primary server's HA_FOC_ORDER configuration parameter is not specified, the failover order is SDS, HDR, and then RSS.

ORDER Usage

The ORDER attribute specifies if automatic failover is enabled. If failover cannot complete, the Connection Manager reattempts failover at increasing intervals, up to 60 seconds, for a maximum of two days.

To modify the number of seconds that must elapse before the active-arbiter Connection Manager starts failover processing, set the EVENT_TIMEOUT parameter.

If you configure failover, you can set the CMALARMPROGRAM parameter to specify a program or script to run if failover processing cannot complete after eight tries.

Important: If automatic failover is enabled, and failover processing begins, you must not manually restart the failed primary server until failover processing completes.

PRIORITY Usage

If you install Connection Managers on application-server hosts, you can use the PRIORITY attribute to prioritize the connections between the application servers and the primary server of a cluster.

If the network connection between a specific Connection Manager and primary database server fails, PRIORITY determines whether the Connection Manager starts failover. If failover would promote a database server that cannot communicate with an active, higher-priority Connection Manager, then failover does not occur. If failover would promote a database server that cannot communicate with an active, lower-priority Connection Manager, failover can occur.

Example 1: Configuring multiple Connection Managers for failover

In the following example, the HA_FOC_ORDER configuration parameter in the my_primary_server_1 onconfig file is set:
HA_FOC_ORDER SDS,HDR,RSS

Three Connection Managers are installed and have the following configuration files:

cm_configuration_file_1
NAME my_connection_manager_1

CLUSTER my_cluster_1
{
   INFORMIXSERVER my_server_group_1
   SLA sla_1 DBSERVERS=ANY
   FOC ORDER=ENABLED \
       PRIORITY=1
   CMALARMPROGRAM $INFORMIXDIR/etc/cmalarmprogram.sh
}
cm_configuration_file_2
NAME my_connection_manager_2

CLUSTER my_cluster_1
{
   INFORMIXSERVER my_server_group_1
   SLA sla_2 DBSERVERS=ANY
   FOC ORDER=ENABLED \
       PRIORITY=2
   CMALARMPROGRAM $INFORMIXDIR/etc/cmalarmprogram.sh
}
cm_configuration_file_3
NAME my_connection_manager_3

CLUSTER my_cluster_1
{
   INFORMIXSERVER my_server_group_1
   SLA sla_3 DBSERVERS=ANY
   FOC ORDER=ENABLED \
       PRIORITY=3
   CMALARMPROGRAM $INFORMIXDIR/etc/cmalarmprogram.sh
}

When the connection managers are initialized, they each search their hosts's sqlhosts file for a my_server_group_1 entry and connect with the servers that are in the group. The value of the HA_FOC_ORDER configuration parameter in the onconfig file of the primary server in my_server_group_1 is set for each of the Connection Manager, so that all the Connection Managers have a consistent failover policy. The value of the primary server's HA_FOC_ORDER configuration parameter replaces the values of the HA_FOC_ORDER configuration parameters in the onconfig files of all secondary servers in the cluster. This process maintains failover-order consistency if the primary server fails and then a Connection Manager restarts.

If a Connection Manager detects that the primary server failed, it first attempts to convert the most suitable SD secondary server to the primary server. If no SD secondary server is available, the Connection Manager attempts to convert the HDR secondary server into the primary server. If the HDR secondary server is not available, the Connection Manager attempts to convert the most suitable RS secondary server to the primary server.

If failover processing fails after eight attempts, the Connection Manager calls $INFORMIXDIR/etc/cmalarmprogram.sh.

Example 2: Configuring multiple Connection Managers to prioritize the connections between application servers and the primary server of a cluster

In the following example, the HA_FOC_ORDER configuration parameter in the my_primary_server_2 onconfig file is set:

HA_FOC_ORDER HDR,RSS

The two Connection Managers, my_important_app_cm and my_non_essential_app_cm, are installed and configured:

cm_configuration_file_4
NAME important_app_cm
LOCAL_IP 192.0.2.0, 192.0.2.256

CLUSTER my_cluster
{
   INFORMIXSERVER my_server_group_1
   SLA sla_1 DBSERVERS=ANY
   FOC ORDER=ENABLED \
       PRIORITY=1
}
cm_configuration_file_5
NAME non_essential_app_cm
LOCAL_IP 192.0.2.257, 192.0.2.258

CLUSTER my_cluster
{
   INFORMIXSERVER my_server_group_1,
   SLA sla_2 DBSERVERS=ANY
   FOC ORDER=ENABLED \
       PRIORITY=2
}
  • The network state is:
  • important_app_cm can connect to the primary server and RS secondary server, but cannot connect to the HDR secondary server.
  • non_essential_app_cm can connect to the primary server and the HDR server, but cannot connect to the RS secondary server.

If the network between non_essential_app_cm and my_primary_server goes down, non_essential_app_cm attempts failover to the HDR secondary server. Because important_app_cm cannot connect to the HDR secondary server, and has higher priority than non_essential_app_cm, the failover attempt is blocked.

If, instead, the network between important_app_cm and my_primary_server goes down, important_app_cm attempts failover to the HDR secondary server. Because important_app_cm cannot connect to the HDR secondary server, it then attempts failover to the RS secondary server. non_essential_app_cm cannot connect to the RS secondary server, but it has a lower priority than important_app_cm, so failover occurs.

In both situations, the connection between important_app_cm and the primary server is prioritized over the connection between non_essential_app_cm and the primary server. Because the Connection Managers are on the application-server hosts, the connections between the application servers and the primary server are, essentially, prioritized.


Copyright© 2019 HCL Technologies Limited