To configure high availability support, you can configure the Sysplex workload balancing and automatic client reroute features together. When you configure a client to use the Sysplex workload balancing feature, the automatic client reroute feature is enabled by default. If the automatic client reroute feature is enabled with the Sysplex workload balancing feature, you need to change keyword values that are related to automatic client reroute only to fine-tune automatic client reroute operation.
Table 1 describes the basic configuration settings that are necessary to enable Sysplex workload balancing for applications other than Java applications.
Data-sharing access method | Client setting | Value |
---|---|---|
Group access | The enableWLB keyword in the <wlb> section of the IBM data server driver configuration file (db2dsdriver.cfg) | true: The default value that enables the WLB feature. |
Database host (host)1 | The group IP address or domain name of the data sharing group. | |
Database port (port)1 | The SQL port number for the DB2 location. | |
Database name (name)1 | The DB2 location name that is defined during installation. | |
Member-specific access | The enableWLB keyword in the <wlb> section of the IBM data server driver configuration file (db2dsdriver.cfg) | true: The default value that enables the WLB feature. |
Database host (host)1 | The group IP address or domain name of the data sharing group. | |
Database port (port)1 | The port number for the DB2 location alias. | |
Database name (name)1 | The DB2 location alias that represents a subset of the members of the data sharing group. |
To fine-tune Sysplex workload balancing, additional keywords are available. The additional keywords for applications other than Java applications are listed in Table 2.
Keyword in the IBM data server driver configuration file (db2dsdriver.cfg) | Section in the IBM data server driver configuration file (db2dsdriver.cfg) | Description |
---|---|---|
maxRefreshInterval | <wlb> | Specifies the maximum elapsed time in seconds before the server list is refreshed. The default is 10. The minimum supported value is 0. |
maxTransportIdleTime | <wlb> | Specifies the maximum elapsed time in seconds before an idle transport is dropped. The default is 60. The minimum supported value is 0. |
maxTransports | <wlb> | Specifies
the maximum number of physical connections (or transports) that the
requester can make to the data sharing group. A maximum of one transport
per member can be opened for each application connection. For example,
25 application connections that access a six-member group can open
a maximum of 150 transports to the group. That means that six transports,
one to each member, can be opened for each application connection. The default value of the maxTransports keyword is 1000. The value of -1 specifies the use of as many transports as necessary based on the number of application connections and members in use. |
maxTransportWaitTime | <wlb> | Specifies the number of seconds that the client waits for a transport to become available. The default value is 1 second. Specifying the value as -1 means unlimited wait time. The minimum supported wait time is 0. |
Automatic client reroute capability is enabled in a client by default when the WLB feature is enabled. At the first connection to the server, the client obtains a list of servers from the connected group. The server list contains all available servers with the capacity to run work. The server list might not contain all members of the DB2 data sharing group because only the available servers with capacity to run work are included in the list. Other than the case where the server list is used to connect to the alternate servers, a connection to a DB2 data sharing group uses the z/OS Sysplex distributor that is configured with the distributed dynamic virtual IP address. The z/OS Sysplex distributor uses the dynamic virtual IP address (VIPA) and automatic VIPA takeover to distribute incoming connections among the DB2 subsystems within the Sysplex environment. The z/OS Sysplex workload balancing feature helps ensures the high availability of a DB2 data sharing group.
To control automatic client reroute behavior, you can set configuration keywords and registry variables in the IBM data server driver configuration file (db2dsdriver.cfg) . The keyword descriptions in Table 3 are for the case in which client affinities are not enabled. If the IBM data server driver configuration file (db2dsdriver.cfg) changes, your CLI application can invoke the SQLReloadConfig function to validate the entries for all alternate servers within the <acr> section.
Keyword in the <acr> section of the db2dsdriver.cfg configuration file | Value |
---|---|
acrRetryInterval | Specifies the number of seconds to wait between consecutive connection attempts. The valid range is 0 - maximum integer value. The value of the DB2_CONNRETRIES_INTERVAL registry variable overrides the value of the acrRetryInterval keyword. The default is 0 (no wait) if you do not set the DB2_CONNRETRIES_INTERVAL registry variable. If you enable automatic client reroute to a DB2 for z/OS data sharing group, the default value of no wait is recommended. |
detectReadonlyTxn | Specifies
whether a connection can seamlessly fail over to a new member when
the automatic client reroute feature is enabled, even if the failed
statement is not the first SQL statement in a transaction. You can
specify the detectReadonlyTxn keyword for a connection
to DB2 for z/OS Version
11 in new function mode (NFM) with the automatic client reroute and
Sysplex workload balancing features enabled. The default value of
the detectReadonlyTxn keyword is false for
connection to supported DB2 for z/OS servers. Setting
the detectReadonlyTxn keyword to true forces
the connected server to return the latest values of special registers
and session global variables whenever they are modified.
Restriction: You cannot set the detectReadonlyTxn keyword
to true in a transaction with the repeatable read
(RR) or read stability (RS) isolation level.
|
enableAcr | Specifies whether automatic client reroute is in effect. The default is true. |
enableSeamlessAcr | Specifies whether seamless failover can occur. If the enableAcr keyword is set to true, the default for the enableSeamlessAcr keyword is true. The enableSeamlessACR keyword applies only to the members within a group or cluster. When you enable automatic client reroute to a DB2 for z/OS data sharing group, you must ensure that the enableSeamlessACR keyword is set to the default value of true and that the application can handle the SQL30108N exception. |
maxAcrRetries | Specifies the maximum number of connection attempts for automatic client reroute. The valid range is 0 - maximum integer value (MAX_INT). The value of the DB2_MAX_CLIENT_CONNRETRIES registry variable overrides the value of the maxAcrRetries keyword. If you do not set the DB2_MAX_CLIENT_CONNRETRIES registry variable or maxAcrRetries keyword, by default, one retry of each server in the server list and the group IP address is attempted. Setting the value of the maxAcrRetries keyword to 0 disables ACR. |
The registry variables in Table 4 control retry behavior for automatic client reroute.
Registry variable | Value |
---|---|
DB2_CONNRETRIES_INTERVAL | Specifies the number of seconds between consecutive connection retries. The default is 10 if you set the DB2_MAX_CLIENT_CONNRETRIES variable. |
DB2_MAX_CLIENT_CONNRETRIES | Specifies the maximum number of connection retries for automatic client reroute. The default is 30 if you set the DB2_CONNRETRIES_INTERVAL variable. |
When enabling automatic client reroute in a connection to a DB2 for z/OS data sharing group, set the maxAcrRetries keyword. If you do not set both the DB2_MAX_CLIENT_CONNRETRIES and DB2_CONNRETRIES_INTERVAL registry variables or do not set both the maxAcrRetries and acrRetryInterval keywords, automatic client reroute attempts to connect to a z/OS group for up to 10 minutes, with no wait between attempts.
If you must use the Sysplex workload balancing feature but your applications cannot handle the errors that are returned for automatic client reroute processing, set the following keywords in the IBM data server driver configuration file (db2dsdriver.cfg).
Keyword in the IBM data server driver configuration file (db2dsdriver.cfg) | Section in the IBM data server driver configuration file (db2dsdriver.cfg) | Description | Value to set |
---|---|---|---|
connectionLevelLoadBalancing | <database> | Specifies whether connection-level load balancing is in effect. By default, if the enableWLB configuration keyword is set to true, the connectionLevelLoadBalancing keyword is set to true. Otherwise, the default value of the connectionLevelLoadBalancing keyword is false. | true |
enableAcr | <acr> | Specifies whether automatic client reroute is enabled. For CLI or .NET applications, enabling automatic client reroute automatically enables seamless failover. By default, if the enableWLB keyword is set to true, the enableAcr keyword is set to true. Otherwise, the default of theenableAcr keyword is false. If your application cannot handle the seamless failover exception (SQL30108N), set the enableAcr keyword to false if you set the enableWLB keyword to true. | true |
enableAlternateGroupSeamlessACR | <acr> | Specifies seamless or non-seamless failover behavior across groups. The default is false. To set this keyword to true, you must also set the enableSeamlessACR configuration keyword to true. Setting the enableAlternateGroupSeamlessACR keyword to true does not affect the setting of the enableSeamlessACR keyword. If a connection is established to a server in the alternategroup subsection, the rules for seamless or non-seamless behavior still apply. | true |
enableSeamlessAcr | <acr> | Specifies whether seamless failover is enabled. Seamless failover is supported only for Java, CLI, and .NET applications. By default, the enableSeamlessAcr keyword is set to the same value as the enableAcr keyword. | true |
enableWLB | <wlb> | Specifies whether workload balancing is enabled. By default, the enableWLB keyword is set to false. | true |