Multiplexed instances and Mirroring Controller can be started and stopped automatically in line with the starting and stopping of the operating system of the database server.
Note
To guarantee the startup sequence of Mirroring Controller on the primary and standby servers, first confirm that the primary server has started, and then start the standby servers in sequence.
The startup sequence of the Mirroring Controller process on the database server and the Mirroring Controller arbitration process on the arbitration server is not guaranteed. If the arbitration server cannot be started first, execute the mc_ctl command in start mode with the --async-connect-arbiter option specified to start the Mirroring Controller process.
If you start the Mirroring Controller and multiplexed instances, wait for time correction, network setup, and so on.
Perform the following procedure:
Create a unit file
Copy the unit file sample stored in the directory below, and revise it to match the target instance.
Sample file
/installDir/share/mcoi.service.sample
Example)
In the following example, the installation directory is "/opt/fsepv<x>server64", and the instance name is "inst1". Note that "<x>" indicates the product version.
# cp /opt/fsepv<x>server64/share/mcoi.service.sample /usr/lib/systemd/system/mcoi_inst1.service
Revise the underlined portions of the options below in the unit file.
Section | Option | Specified value | Description |
---|---|---|---|
Unit | Description | Fujitsu Enterprise Postgres MirroringController instanceName | Specifies the feature overview. Specifies the name of the target instance. (*1) |
Service | ExecStart | /bin/bash -c 'installDir/bin/mc_std start installDir MirroringControllerManagementDir' mc_ctlOption' | Command to be executed when the service is started. Specify the option you want to add when the mc_ctl command is executed without the -M option in the mc_ctl option. Note that the content specified in this mc_ctl option is carried over from the mc_std command to the mc_ctl command. (*2) |
ExecStop | /bin/bash -c 'installDir/bin/mc_std stop installDir MirroringControllerManagementDir' mc_ctlOption' | Command to be executed when the service is stopped. Specify the option you want to add when the mc_ctl command is executed without the -M option in the mc_ctl option. However, to use the --mc-only option to stop only Mirroring Controller, you must use the --mc-only option at startup. Note that the content specified in this mc_ctl option is carried over from the mc_std command to the mc_ctl command. | |
User | User | OS user account of the instance administrator user. | |
Group | Group | Group to which the instance administrator user belongs. |
*1: The instance name should be as nameThatIdentifiesTheInstance.
The naming conventions for identifying the instance are as follows:
Up to 16 bytes
The first character must be an ASCII alphabetic character
The other characters must be ASCII alphanumeric characters
*2: When the arbitration server is used for automatic degradation, start the Mirroring Controller arbitration process on the arbitration server and then start the Mirroring Controller process on the database server. If the arbitration server cannot be started first, specify the --async-connect-arbiter option to start the Mirroring Controller process.
Enable automatic start and stop
As the OS superuser, use the systemctl command to enable automatic start and stop.
Example)
# systemctl enable mcoi_inst1.service
Note
If automatic start and stop of Mirroring Controller has been configured, to stop Mirroring Controller, do not use the mc_ctl command, but instead use the systemctl command as the OS superuser.
Example)
# systemctl stop mcoi_inst1.service
If the instance does not stop, refer to "Actions in Response to Failure to Stop an Instance" in the Operation Guide to stop the instance. Then, specify the -e option in the mc_ctl command to forcibly stop Mirroring Controller.
Example)
$ mc_ctl stop -M /mcdir/inst1 -e
If Mirroring Controller is stopped using the mc_ctl command, the message below is output to the system log, however there is no issue because automatic stop is executed by systemd.
Message
FATAL: failed to stop Mirroring Controller target server:"{0}" (MCA00043)