This parameter is used when an Adaptive Server fails to respond in a timely manner, or when the Adaptive Server host cannot be pinged by either OpenSwitch server in a cluster.
WARNING! If you are using a CM or RCM, set SVR_FAIL_ACTION to DEFAULT. Specifically, you cannot run custom or manual scripts for a server failure when you are using a CM or RCM because each CM and RCM is coded differently and its failover procedure may contradict the actions invoked by a custom or manual script.
When you specify DEFAULT for SVR_FAIL_ACTION, OpenSwitch checks whether any CMs or RCMs are connected. When there are CM or RCM connections, OpenSwitch returns, leaving failover actions to be executed by the CM or RCM. When there are no CM or RCM connections, OpenSwitch:
Marks the primary (failed) Adaptive Server as locked
Stops all clients on the failed Adaptive Server
Marks the primary Adaptive Server as DOWN
Marks the secondary Adaptive Server as UP
Switches clients from the primary Adaptive Server to the secondary Adaptive Server
Restarts all clients
Directs all new connections to the secondary Adaptive Server
Use:
DEFAULT – to mark the Adaptive Server as not running and initiate a failover process.
CUSTOM, MANUAL, or CUSTOM_MANUAL – to execute the specified custom or manual script with the reason code 1004, unless you are using a CM or RCM, in which case the action and reason code are ignored, and OpenSwitch allows the CM or RCM to handle the failover.
It is important that the scripts on both OpenSwitch companions perform the same actions because during SVR_FAIL_ACTION, only one of the companions executes the script. For example, if the script for OSW1 restarts the server or notifies the administrator, the script for OSW2 should also restart the server or notify the administrator. Although the actions must be the same in both scripts, the commands that invoke those actions can be different; that is, you could use different commands to restart the server as long as the commands produce the same result.
When you specify MANUAL or CUSTOM_MANUAL, OpenSwitch is suspended and waits indefinitely until the system administrator executes rp_go.
See “User-specified actions” for additional details about these actions.
Valid exit codes are:
0 – the script was successful and OpenSwitch should reconnect all existing clients to the same primary Adaptive Server. This exit code should be returned by a script that has succeeded in restarting the primary Adaptive Server.
OpenSwitch does not change the status of the primary Adaptive Server to DOWN and future connections continue to be routed to that Adaptive Server.
1 – the script was successful and OpenSwitch should fail over all existing clients to the secondary Adaptive Server. This exit code should be returned by a script that sends a notification about the server error, but does not restart the server that is not responding.
OpenSwitch changes the status of the primary Adaptive Server to DOWN and future connections are routed to the next available Adaptive Server in the pool.
2 – the script was unsuccessful and OpenSwitch should terminate all existing clients connections. This exit code should be returned if the script has failed and no automatic failover is to be performed.
If the primary Adaptive Server is down, but is restarted before new client connections occur, clients reconnect to the primary Adaptive Server.
If the primary Adaptive Server has not been restarted, new client connections failover to the secondary Adaptive Server and OpenSwitch changes the status of the primary Adaptive Server to DOWN.
3 – the script was unsuccessful and OpenSwitch should fail over all existing clients to the secondary Adaptive Server. This exit code should be returned if the script has failed, and you want to perform an automatic failover to the next available server.
OpenSwitch changes the status of the primary Adaptive Server to DOWN and all future connections are routed to the next available Adaptive Server in the pool.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |