DB2/390: HA for unplanned DB outage for java stack
[HA] [Java] [MVS] [OS390] [outage] [power outage] [stack] [unplanned trip]
Related:
- DB2-z/OS: Seamless JDBC Database Failover for SAP Java stackSymptom This SAP Note describes how to enable high availability...
- DB2-z/OS: DB2 Connect 9.1 JDBC Failover for SAP Java stackSymptom This SAP Note describes how to enable high availability...
- DB2-z/OS: Distribution of Java instances to DB2 membersSymptom If you have configured more than one SAP JAVA...
- 640PC Edition May 2008:Installation IBM DB2 on z/OSSymptom This SAP Note is valid for the following releases:...
- DB2-z/OS: Encrypt Data between Client and ServerSymptom You want to encrypt data between the application server...
- Enhancements to Solution Manager 7.0 EHP1 upgrade (SPS18,19)Symptom This note describes errors during the upgrade and in...
- DB2/390: Fix Level 090713 ...
- DB2-z/OS: Inconsistent fields with DDIC type RAW/LRAW/VARCSymptom You are requested by a SAP tool or documentation...
Symptom
We strongly recommend to use the Db2 Connect V9 jdbc driver to enable high availability for your j2ee server – see note 1085521 for details. The information in this note applies only if you use the Db2 Connect V8 driver.
For upgrades the high availability setup described in this note is not supported.
This note describes how to enable high availability for your j2ee server in case of unplanned outages of the DB2 for z/OS DBRM. The high availability enablement is based on the automatic client reroute feature of DB2 Connect. It does not cover planned outages, nor does it monitor your database connections.
Other terms
MVS OS/390 HA java
Reason and Prerequisites
For releases NetWeaver 2004 and 2004s the java stack does not actively
support high availability, as does the ABAP stack.
Therefore high availability is achieved by exploiting features of the connectivity middleware which can reroute failing connections to a standby member.
This note describes how to route the connections from the j2ee server to the database engine over a DB2 Connect Gateway. In case of a connection failure the automatic client reroute feature of the DB2 Connect SYSPLEX support will reroute the connection to an alternate (secondary) server.
Solution
Your DB2 DBRM must run in a data sharing environment.
Note that for the automatic client reroute feature of DB2 Connect to work, the location name must be the same for the primary and secondary members.
In case you use more than one network adapter please note that when DB2 Connect SYSPLEX support is enabled the hostname as defined to DDF will be used for communication between the j2ee server and the database host and overwrite different settings on the client side.
Install DB2 Connect on your j2ee application server. If you also run an ABAP stack of Netweaver 2004 or 2004s on this server, DB2 Connect is already installed on the server.
For the automatic client reroute to work, DB2 Connect Enterprise Edition V8 FP 11 Special Build special_15678 or a higher FixPack is required.
Create a new DB2 instance. Do NOT use an instance of an ABAP stack, because both usages require an incompatible set of parameters.
As DB2 instance user (db2inst
1. max_connections must be set to a higher value than max_coordagents:
Call ‘db2 GET dbm cfg’ to retrieve the current values for max_connections and max_coordagents.
To set the parameters, use the call db2 update dbm cfg:
db2 update dbm cfg using max_connections
db2 update dbm cfg using num_poolagents -13. Set svcename the TCP/IP service name configuration parameter to a valid port.
db2 update dbm cfg svcename
Caution: DB2 Connect uses 50000 as default port for svcename. This can easily collide with other applications. E.g. the SAP j2ee server uses 50000 as default for the HTTP port if the instance number is 0.
Next use db2set command to set/check DB2CONNECT_IN_APP_PROCESS and DB2COMM. Call db2set without any parameters to display the values set.
1. Set DB2CONNECT_IN_APP_PROCESS to ‘NO’:
db2set DB2CONNECT_IN_APP_PROCESS=NO2. Set DB2COMM to ‘tcpip’:
db2set DB2COMM=tcpip -i < DB2ADMINSERVER>
You can use the command
db2set DB2ADMINSERVER
to get the current DB2ADMINSERVER e.g. dasusr1.
Catalog the database connection for your primary connection:
1. db2 CATALOG DCS DATABASE
where
You can set
db2 UPDATE ALTERNATE SERVER FOR DATABASE
Once the instance is configured, you need to restart the DB2 gateway:
1. db2stop2. db2start
Now your DB2 Connect gateway is ready for use:
1. Stop your j2ee server.2. Start the configtool:
Change the url of the database connection:a) Choose ‘Secure Store’b) Choose key jdbc/pool/
CAVEAT: The secondary is only recognized by the gateway if at least one successful connect to the primary occurred while the secondary was up.
This is due to the fact that the gateway updates its information about available members at connect time.
As a consequence, the failover will fail if the secondary was down at every connect (at every startup of your j2ee server) since the gateway was started.
Therefore, we recommend to check that the secondary is up when you start the j2ee server the first time after you restarted the gateway (e.g. the machine was rebooted).