IBM Support

How to configure DB2 HADR using Data Sources

Question & Answer


Question

How can you configure IBM Rational Software Architect Design Manager to use IBM DB2 High Availability Disaster Recovery with the aid of Data Sources in IBM WebSphere Application Server?

Cause

You have already configured IBM DB2 to use High Availability Disaster Recovery, and you know the details of your primary and secondary (alternate) databases.

When you run the JTS Setup, you have two options:

  1. a JDBC connection

  2. a J2EE connection to the database

If you choose a JDBC connection, you can only specify the primary database: you have no option to enter the details of the secondary database. You rely uniquely on the JDBC driver to reroute the connection to the alternate DB2 server, if the primary server becomes unavailable.

IBM Rational Software Architect Design Manager, IBM Rational Rhapsody Design Manager and the IBM Collaborative Lifecycle Management products use a JDBC driver Type 4 to connect to IBM DB2. If the primary DB2 server becomes unavailable, the Type 4 JDBC driver will reroute the connection to the alternate server, but only as long as the Java Virtual Machine of the Application Server continues to run.

If the Application Server is stopped and restarted, the information about the alternate server is no longer available, and the connection to the database fails. This happens because the Type 4 JDBC driver does not persist the information related to the alternate server.

Answer

ANSWER

If you want to use IBM DB2 High Availability Disaster Recovery (HADR), it is recommended that you install IBM WebSphere Application Server, and that you configure Data Sources, so that you can use the J2EE connection to the database in JTS Setup.

The Data Source configuration in WebSphere Application Server allows you to specify the connection information for the alternate database. As a result, if the Application Server is restarted, it can find the alternate database and still connect successfully.

  1. Configure IBM DB2 High Availability Disaster Recovery according to the procedure described in this article:
    Configuring IBM DB2 9.7 High Availability Database Repository for Rational Team Concert
    The rest of the article assumes the existence of the computers called: db2hadrvm1 (hosting the primary database) and db2hadrvm2 (hosting the secondary or alternate database) NOTE: Ensure that all computers are accessible via fully qualified names instead of simple names.

  2. Install IBM WebSphere Application Server and create a profile

  3. Start the WebSphere Application Server profile

  4. Launch the WebSphere Integrated Solutions Console, using the URL: http://hostname:port/ibm/console

    NOTE: You can determine the port value opening the file:
    WAS_Installation\profiles\profileName\properties\portdefs.props

    and looking for the value of: WC_adminhost

  5. Navigate to Resources > JDBC > Data sources

  6. Create a Data Source for each Database. The number of databases and data sources depends on which product you are installing. If you use a distributed topology with multiple application servers, create the data source on the application server that hosts the corresponding application. In the case of Rational Software Architect Design Manager, you need three databases, corresponding the applications: jts.war, vvc.war
    , dm.war. In the rest of the article, these databases are called: JTS1, VVC1, DM1. An example is provided for JTS1 only.

  7. Select the scope for the Data Source. This setting defines the scope in which the Data Source can be referenced. In the following, Cell scope was selected.

  8. Click on New

  9. Select a unique name for the Data Source: JTSds

  10. Select a unique JNDI name for the data source: jdbc/JTSds



  11. Click Next

  12. Click on Select an existing JDBC Provider

  13. Select the provider: DB2 Universal JDBC Driver Provider (XA)


  14. Click Next

  15. Select the Driver type: 4

  16. Enter the Database Name: JTS1

  17. Enter the Server Name where the Primary DB2 database is running: db2hadrvm1

  18. Enter the port number where the Primary DB2 database is listening for TCP/IP connections: 50000
    (this may differ on your system).


  19. Click Next

  20. Do not select anything in the page called: Setup security aliases. You will complete these settings later.


  21. Click Next

  22. Review the summary

  23. Click Finish. The Data source will appear as follows:


  24. Click on the Data Source name JTSds to open the Data Source configuration page


  25. Click on the link: Related Items > JAAS - J2C authentication data



  26. Enter a unique value for Alias: jtsalias

  27. Enter the credentials for the database JTS1, for example:
    username: Administrator
    password: password

  28. Notice that, in the end, the Alias will appear as follows:


  29. Click Apply


  30. Click on the link with the Data source name: JTSds

  31. Reference the alias jtsalias in the fields: Authentication alias for XA recovery, Component-managed Authentication alias and Container-managed authentication alias:



  32. Click on Advanced properties>WebSphere Application Server data source properties


  33. Scroll down till the section called DB2 automatic client reroute options

  34. Enter values similar to the following:
    Retry interval for client reroute: 10 seconds
    Maximum retries for client reroute : 6 retries
    Alternate server names: db2hadrvm2
    Alternate port numbers: 50000
    Client reroute server list JNDI name: jdbc/JTSds2


    Note 1: If you choose to use Client reroute server list JNDI name, you do not need to supply Alternate server names and Alternate port numbers (and vice versa).
    Note 2: The Client reroute server list JNDI name should be a unique JNDI name, different from the JNDI Name used in the previous step.
    For more information on these properties, refer to: Configuring client reroute for applications that use DB2 databases in the WebSphere Application Server InfoCenter.
  35. Click Apply

  36. Click on Save directly to the master configuration


  37. Select the Data Source JTSds, on the main Data Source page

  38. Click on Test Connection


  39. Notice that the message states: The test connection operation for data source JTSds on server serverName at node nodeName was successful.

  40. Repeat these steps to create one Data source for each database

  41. Restart WebSphere Application Server

Testing the HADR setup from WebSphere Application Server

Prior to installing Rational Software Architect Design Manager, you can test the setup of the Data sources as follows:
  1. Browse to the Data source and click on Test Connection, while JTS1 in db2hadrvm1 is set to be the Primary database

  2. Stop the Database on db2hadrvm1. From an administrative DB2 command prompt, execute:
    db2stop force
    (NOTE: This stops the database even if there are applications connected to it. Verify with your Database administrator if it is acceptable to perform this command).

  3. Perform a takeover on db2hadrvm2: db2 takeover hadr on database JTS1 by force DB20000I  The TAKEOVER HADR ON DATABASE command completed successfully.

  4. Verify that the alternate database has now become the Primary database:


    db2pd -db JTS1 -hadr

    Database Partition 0 -- Database JTS1 -- Active -- Up 10 days 01:26:36

    HADR Information:
    Role    State                SyncMode HeartBeatsMissed   LogGapRunAvg (bytes)
    Primary Disconnected         Nearsync 0                  0

    ConnectStatus ConnectTime                           Timeout
    Disconnected  Thu Feb 13 05:51:13 2014 (1392299473) 120

    LocalHost                                LocalService
    db2hadrvm2                          64001

    RemoteHost                               RemoteService      RemoteInstance
    db2hadrvm1                          64000              DB2

    PrimaryFile  PrimaryPg  PrimaryLSN
    S0000018.LOG 4095       0x000000002F38AF00

    StandByFile  StandByPg  StandByLSN
    S0000000.LOG 0          0x0000000000000000


  5. Open the WebSphere Integrated Solutions Console

  6. Select the Data source

  7. Click on Test Connection

  8. Stop and restart WebSphere Application Server

  9. Open the WebSphere Integrated Solutions Console

  10. Select the Data source

  11. Click on Test Connection

If all these tests succeed, your Data source is properly configured to support HADR and you can proceed to install Rational Software Architect Design Manager with IBM Installation Manager.

Run JTS Setup and configure the connection to the Databases using Data sources

  1. Run JTS Setup

  2. Reach the page where you must configure the first database for the Jazz Team Server

  3. Select the Database type: DB2

  4. Select the Connection Type: J2EE (the other possible value is JDBC)

  5. Select the property J2EE Datasource and enter the JNDI name of the datasource: jdbc/JTSds



  6. Proceed with the setup, and configure all other databases as described above.

[{"Product":{"code":"SSUVV6","label":"IBM Engineering Test Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"3.0.1;3.0.1.1;3.0.1.2;3.0.1.3;3.0.1.4;3.0.1.5;3.0.1.6;4.0;4.0.0.1;4.0.0.2;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SSUC3U","label":"IBM Engineering Workflow Management"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":"General Information","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"3.0;3.0.1;3.0.1.1;3.0.1.2;3.0.1.3;3.0.1.4;3.0.1.5;3.0.1.6;4.0;4.0.0.1;4.0.0.2;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SSRMY8","label":"Rational Software Architect Design Manager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General Information","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"3.0;3.0.0.1;3.0.1;4.0;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SSRNEV","label":"Rational Rhapsody Design Manager"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"3.0;3.0.0.1;3.0.1;4.0;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SSWMEQ","label":"Rational Requirements Composer"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"3.0.1;3.0.1.1;3.0.1.2;3.0.1.3;3.0.1.4;3.0.1.5;3.0.1.6;4.0;4.0.0.1;4.0.0.2;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Team Concert;Rational Quality Manager

Document Information

Modified date:
29 September 2018

UID

swg21665033