You can automatically start or stop an instance when the operating system on the database server is started or stopped.
Use the following procedure to configure automatic start and stop of an instance.
Note that, if an instance is started in a failover operation, the cluster system will control the start or stop, therefore this feature should not be used. Also, when performing database multiplexing, refer to "Enabling Automatic Start and Stop of Mirroring Controller and Multiplexed Instances" in the Cluster Operation Guide (Database Multiplexing).
Note that "<x>" in paths indicates the product version.
Create a unit file
Copy the unit file sample stored in the directory below, and revise it to match the target instance.
fujitsuEnterprisePostgresInstallDir/share/fsepsvoi.service.sample
In the following example, the installation directory is "/opt/fsepv<x>server64", and the instance name is "inst1".
# cp /opt/fsepv<x>server64/share/fsepsvoi.service.sample /usr/lib/systemd/system/fsepsvoi_inst1.service
Revise the underlined portions of the options below in the unit file.
Section | Option | Specified value | Description |
---|---|---|---|
Unit | Description | Fujitsu Enterprise Postgres instanceName | Specifies the feature overview. Specifies the name of the target instance. (*1) |
Service | ExecStart | /bin/bash -c 'installDir/bin/pgx_symstd start installDir dataStorageDestinationDir' | Command to be executed when the service is started. |
ExecStop | /bin/bash -c 'installDir/bin/pgx_symstd stop installDir dataStorageDestinationDir' | Command to be executed when the service is stopped. | |
ExecReload | /bin/bash -c 'installDir/bin/pgx_symstd reload installDir dataStorageDestinationDir' | Command to be executed when the service is reloaded | |
User | User | OS user account of the instance administrator. | |
Group | Group | Group to which the instance administrator user belongs. |
*1: The instance name should be as follows:
If WebAdmin is used to create the instance: instanceName
If the initdb command is used to create the instance: nameThatIdentifiesTheInstance
The naming conventions for the instance name or 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
Enable automatic start and stop
As the OS superuser, use the systemctl command to enable automatic start and stop.
# systemctl enable fsepsvoi_inst1.service