Informix HA Cluster and CM
Posted in 2023
Tereso Garcia asked how to set up an Informix HA cluster with the Connection Manager (CM) and whether Linux clustering was needed. Art Kagel outlined the CM config, SLAs and sqlhosts; David Williams said the cluster is an Informix concept and the active arbitrator uses HA_FOC_ORDER and ha make primary force. Tereso's follow-ups on sqlhosts ports and multiple CMs are unanswered.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: High Availability & Replication, Networking & sqlhosts Configuration, Platform-Specific Issues, Clustering, Grid & MACH11
I need to setup a HA cluster with replication. We are able to replica and test failover both ways on node1 and node2. HOw do I get a cluster server on these 2 nodes. so that the Connection Mgr is able to control failover and route connections to the new active node? Do I need to setup Linux OS cluster or Do I need to only setup the S=6 on the sqlhosts or C=1 at the option column on the sqlhosts ? So it only be informix configuration and no Linux OS setup at all ? Do I require to setup a group among node1 and node2 like this topology picture for Primary / Secondary under group 1. I am confused how the CM knows the secondary is now the active node as in a regular cluster where the heartbit promotes the secondary and node2 now owns the cluster listener on a linux cluster. ------------------------------ Tereso Garcia ------------------------------
OK, here's how it goes. You have two servers, a primary and an HDR secondary, call them node1 on host1 and node2 on host2 and you have a single Connection Manager, call it CM1 on host3. The servers each have a TCP and shared memory connection type defined, call them node1_tcp and node2_tcp and node1_shm and node2_shm respectively. Ideally you should have at least two and preferably three or four CMs, one on each host containing a server and one or two on a separate hosts.
Let's assume that you only have a single SLA defined in each CM. For now, with one CM, call the SLA cm1_sla. The CM config file will look something like this:
#
# Connection Manager configuration
#
NAME cm1
LOG 1
LOGFILE $INFORMIXDIR/tmp/cmsm_cm1.log
CLUSTER cluster_1
INFORMIXSERVER node_grp
SLA cluster_sla_1 DBSERVERS = PRI
FOC ORDER=ENABLED TIMEOUT=30 RETRY=10 PRIORITY=1
}
The sqlhosts files (which should be the same except for the shared memory connection name configurations on each host) should look like this:
cluster group - - i=2,c=1 # Connectin Manager failover group
cluster_sla_1 onsoctcp host3 sqlexec2# cluster_sla_2 onsoctcp host4 sqlexec2 # Optional secondary CM on host4
# cluster_host1 onsoctcp host1 sqlexec2 # Optional local CM on host1
# cluster_host2 onsoctcp host2 sqlexec2 # Optional local CM on host2
####
# Failover group
####
node_grp group - - i=1,c=1,e=node2_tcp
node1_tcp onsoctcp host1 sqlexec g=node_grp
node2_tcp onsoctcp host2 sqlexec g=node_grp
Clients connect to <database>@cluster or have INFORMIXSERVER set to "cluster" and are connected to a random CM (if you configure more than one in the group "cluster". The Connection Manager that gets the connection matches the "servername" associated with it in the client's sqlhosts group, checks the cluster definitions it knows for that SLA and redirects the client to the current primary server in that cluster based on the SLA configuration.
You can certainly add the s=6 option and use dedicated server aliases for the connections between the primary and secondary servers, but the clients must connection on a "normal" entry that does not contain the s=6 designation.
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
------------------------------
The cluster is an Informix concept, nothing to do with Linux clusters. The connection manager will connect to each server in the Informix cluster and determine it's role Primary.SDS,HDR,RSS One connection manager will be the "Active Arbitrator" and if it cannot contact the primary it will use HA_FOC_ORDER https://informix.hcldoc.com/12.10/help/index.jsp?topic=%2Fcom.ibm.adref.doc%2Fids_adr_1158.htm (Normally HDR) to decide which node to make the new primary with sysadmin command "ha make primary force" https://informix.hcldoc.com/12.10/help/index.jsp?topic=%2Fcom.ibm.adref.doc%2Fids_sapi_029.htm Regards, David. ------------------------------ David Williams ------------------------------
Thanks so much David, that clears many of my questions. From what I have read on the CM, it only routes the connection request. It uses its local sqlhosts file to accommodate the connection or any sqlhost on the primary instance or HDR. The next question is. My current single instance has a good number of sqlhosts connections defined and service ports. Lets say 12 of them, those are mapped to INFORMIXSERVER Aliases. If we decide to start using CM for failover control and connection routing, how would the CM use those ports on the original instance or the primary ? DO I need to define those connections on the CM sqlhosts file ? ------------------------------ Tereso Garcia ------------------------------
Thanks so much Art. What is the purpose of using more than 1 CM. I assume for redundancy and if there are hundreds of connections requests, various CM could handle the routing to the primary. Then those several CMs must be under a load balancer ? Thanks Tereso ------------------------------ Tereso Garcia ------------------------------