This section explains how to create a user exit for a database server.
The user command types explained below can be used as user exits. These commands are called by Mirroring Controller management processes.
The user can create user exits as required.
Specify the user commands that were created for the parameters in the server configuration file of the database server. Refer to "A.4.1 Server Configuration File for the Database Servers" for information on these parameters.
User command types
Fencing command
This user command performs fencing if Mirroring Controller performs arbitration processing and determines that a database server is unstable.
Arbitration command
This user command performs arbitration processing in lieu of the arbitration server when there is no arbitration server.
State transition commands
These user commands are called when Mirroring Controller performs state transition of a database server.
It includes the following types:
Post-switch command
This user command is called after a promotion from standby server to primary server.
Pre-detach command
This user command is called before the standby server is disconnected from a cluster system.
If the pre-detach command is specified on both the primary server and standby server, it is called first on the standby server and then on the primary server.
If the settings are configured to forcibly stop the instance on the standby server when the standby server is disconnected, the pre-detach command is called on the standby server and then the instance on the standby server is stopped.
Post-attach command
This user command is called after the standby server has been attached to a cluster system.
If the post-attach command is specified on both the primary server and standby server, it is called first on the primary server and then on the standby server.
Point
When the arbitration server is used for automatic degradation and the requirements can be satisfied using the fencing command on the arbitration server only, the fencing command on the database server is not required. In addition, if the requirements can be satisfied using the fencing command on the database server only, create a fencing command on the arbitration server for termination processing only (without implementation).
User command | Operation when a heartbeat abnormality is detected using operating system or server heartbeat monitoring | Database server calling the command | ||||
---|---|---|---|---|---|---|
Message output | Automatic degradation by arbitration server | Automatic degradation by arbitration command | Unconditional automatic degradation | Primary server | Standby server | |
Fencing command | Y (*1) | Y (*2) | R | N | Y | Y |
Arbitration command | N | N | R | N | Y | Y |
Post-switch command | Y | Y | Y | Y | Y | N |
Pre-detach command | Y | Y | Y | Y | Y | Y (*3) |
Post-attach command | Y | Y | Y | Y | Y | Y (*3) |
R: Required
Y: Can be used
N: Cannot be used
*1: Called only when the mc_ctl command is used to execute forced switching or forced disconnection.
*2: Creation of a fencing command on a database server is optional, but it must be created on the arbitration server.
*3: If message output or unconditional automatic degradation is selected, this command is called only from the primary server.
See
Refer to "Appendix C User Commands" for information on the interface for each user command.