Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

DRDA redirection to HDR primary

  • 1.  DRDA redirection to HDR primary

    Posted 3 days ago

    I was recently unable to work out how to do this directly on latest IDS 14.10. I am about to write a technical article on a work-around using Connection Manager, but that involves more effort and failure points. Does anyone know how to construct a DRDA client configuration so that it connects to whichever is the primary in an HDR pair like you can in "sqlhosts" for native TCP connections?



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------


  • 2.  RE: DRDA redirection to HDR primary

    Posted 3 days ago

    Hi Doug,

    I vaguely remember having dealt with this, my notes having things like alternateserverlist and enableAlternateServerListFirstConnect
    and a pointer to https://www.ibm.com/docs/en/db2/11.5.x?topic=njcshads-non-java-client-support-high-availability-connections-informix-servers

    Basically, I think what you're looking for is part of the DRDA protocol, so needs to be configured on that level (outside of onconfig, and outside of sqlhosts anyway).

    HTH,
     Andreas



    ------------------------------
    Andreas Legner
    Informix Dev
    HCL Software
    ------------------------------



  • 3.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Hi Andreas.

    Indeed. I was able to get that working with a Connection Manager on each IDS server as follows:

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    
    <configuration>
    
      <!--
        C:\ProgramData\IBM\DB2\IBMDBCL1\cfg\db2dsdriver.cfg
    
        Informix cluster IBM Data Server Driver prototype configuration file
        Doug Lawry, Oninit Consulting, January 2026
    
        Routes to Informix Connection Manager (CM) on either of two Informix hosts.
        Informix Dynamic Server (IDS) instances also run on each of those same hosts.
        High-availability Data Replication (HDR) maintains a passive read-only replica.
        Server 1 is usually the primary IDS instance and therefore more heavily loaded.
        Server 2 is therefore the preferred CM, so use DSN "alias2" in applications.
        Test with: testconn40 "database=alias2;userid=...;password=..."
      -->
    
      <dsncollection>
        <dsn alias="alias1" name="dbname" host="host1" port="9089"/>
        <dsn alias="alias2" name="dbname" host="host2" port="9089"/>
      </dsncollection>
    
      <databases>
    
        <database name="dbname" host="host1" port="9089">
          <acr>
            <!-- Automatic client reroute -->
            <parameter name="enableAlternateServerListFirstConnect" value="true"/>
            <alternateserverlist>
              <server name="alias2" hostname="host2" port="9089"/>
            </alternateserverlist>
          </acr>
        </database>
    
        <database name="dbname" host="host2" port="9089">
          <acr>
            <!-- Automatic client reroute -->
            <parameter name="enableAlternateServerListFirstConnect" value="true"/>
            <alternateserverlist>
              <server name="alias1" hostname="host1" port="9089"/>
            </alternateserverlist>
          </acr>
        </database>
    
      </databases>
    
    </configuration>

    But I can't find a way above to make it connect to whichever is the primary IDS server in an alternate server list so that we don't need Connection Managers at all, as with an sqlhosts group for standard TCP listeners.



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 4.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Andreas: if I don't get a solution here, is this something I should open as a support request. It will be an RFE otherwise.



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 5.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Hi Doug,

    if I'm getting you right (upon rereading), you want the connection protocol to

    • determine whether what you're connecting to is a primary (or standard) and
    • if not (it's a secondary), to tell the client who the primary is and
    • possibly how/where to reach that

    This is not even what you'd get from sqlhosts group connects  (they'd simply walk all the group members until they get connected, no matter the cluster role).

    In fact this is one of the CM's core functionalities, and I don't think this can/should be packed into the connection protocol, neither SQLI nor DRDA.

    Sorry for not seeing it this way in my previous post, and let me know if I'm again missing anything.

    Have a nice weekend!

     Andreas



    ------------------------------
    Andreas Legner
    Informix Dev
    HCL Software
    ------------------------------



  • 6.  RE: DRDA redirection to HDR primary

    Posted 11 hours ago

    Hi Andreas.

    Not so! We have used groups that way as long as I can remember. For example:

    https://www.ibm.com/docs/en/informix-servers/14.10.0?topic=cshac-properties-connecting-high-availability-cluster-servers-through-sqlhost-file-group-entries

    It's the same for other APIs that use "sqlhosts" or equivalent Windows registry constructions, though I can only find a clear statement for JDBC as above.

    Will post a proof of that with "dbaccess" next time I have a test cluster running.



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 7.  RE: DRDA redirection to HDR primary

    Posted 10 hours ago

    Andreas:

    Doug is correct. Using an sqlhosts group that includes both primary and secondary servers, a connection to the group name will preferentially connect to a primary over secondaries even if the secondaries are listed earlier in the group within the sqlhosts file. It has always worked that way for native SQLI connections.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 8.  RE: DRDA redirection to HDR primary

    Posted 2 days ago
    We implemented the DRDA connection using the ConnectionManager
    Normal Connections went on CM1, DRDA from Cognos to CM2

    This works as described:

    1. Create ONSOCTCP connections on DBSERVERNAME and DRSOCTCP connections on DBSERVERALIASES
    2. Create separate Instances of the Connection Manager to handle SOCTCP (with Failover enabled) and DRDA (Failover disabled)
      1. First instance contains only the DBSERVERNAMES that are SOCTCP connections in the SERVERLIST
      2. Second instance contains only the DBSERVERALIASES that are DRDA connections in the SERVERLIST
    3. Start different instances of the CM and use these for the different connection types

    This configuration can be made redundant, when you define a second pair of CMs on an other server and connect the CM-Names in the
    Sqlhosts File of the client to a connection group (for example: g=cm and g=cmdrda)

    This installation worked very stable and switched normal connections and DRDA for Cognos whenever one server was down.

    Mit freundlichen Grüßen / Kind regards

     

    Gerd Kaluzinski

    Delivery Consultant Data

     

    IBM Technology Expert Labs

    Phone: +49 175 228 1983                         IBM Deutschland GmbH

    Email: gerd.kaluzinski@de.ibm.com               Mies-van-der-Rohe-Straße 6, 80807 München

     

    IBM Deutschland GmbH

    Vorsitzender des Aufsichtsrats: Ivo Körner

    Geschäftsführung: Wolfgang Wendt (Vorsitzender), Dr. Andreas Buchelt, Dr. Frank Kohls, Christine Rupp

    Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562

     






  • 9.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Hi Gerd.

    Thanks, but the purpose of this thread is to get automated HDR fail-over redirection working without Connection Manager.



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------



  • 10.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Doug:

    I don't know, but does the DRDA driver obey using sqlhosts groups? They can be used for failover and default to using the primary or the first listed group member if all are peers.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 11.  RE: DRDA redirection to HDR primary

    Posted 2 days ago

    Hi Art.

    IBM Data Server Driver doesn't use "sqlhosts" as it's shared with DB2. That's the problem.



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------