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 S. Kagel, President and Principal Consultant
ASK Database Management Corp.
Original Message:
Sent: Sun January 25, 2026 11:22 AM
From: Doug Lawry
Subject: DRDA redirection to HDR primary
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
Original Message:
Sent: Fri January 23, 2026 01:31 PM
From: Andreas Legner
Subject: DRDA redirection to HDR primary
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
Original Message:
Sent: Fri January 23, 2026 09:41 AM
From: Doug Lawry
Subject: DRDA redirection to HDR primary
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
Original Message:
Sent: Fri January 23, 2026 09:36 AM
From: Doug Lawry
Subject: DRDA redirection to HDR primary
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
Original Message:
Sent: Thu January 22, 2026 10:47 AM
From: Andreas Legner
Subject: DRDA redirection to HDR primary
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
Original Message:
Sent: Thu January 22, 2026 07:42 AM
From: Doug Lawry
Subject: DRDA redirection to HDR primary
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
------------------------------