I have a replica with a primary server and secundary server, I am executing a select in primary server but this server fail or is down, I need this select connect to secundary server automatically. ¿What to do for this activity? ¿You can give me an example, please?
The processes of redirection over HDR enviroment work this way:
- If the primary server is down, the client will lost the connection and the current transaction will abort, the program must be prepared to handle with this situation. When it try reconnect to server again will be automatic redirect to secondary server...
To work this way you must set your SQLHOSTS (server and client) some like this:
On client environment:
- You must set the INFORMIXSERVER = ids_master
- Set INFORMIXCONTIME and INFORMIXCONRETRY proper (this variables config the timeout and how many time try to connect).
When your client try to conect , will follow the order of the servers, if the first is off line, it just jump to next...
The parameter c=0 is not necessary because is the default option.... but i like to specify...
If you have more instances listed on the same SQLHOSTS, add the options e= or g= .