Top
Enterprise Postgres 17 Cluster Operation Guide(Database Multiplexing)

2.4.1 Setting Up Database Multiplexing Mode on the Primary Server

This section explains how to set up database multiplexing mode on the primary server.

In database multiplexing, the files that are required for operations are managed in the Mirroring Controller management directory.

There is one Mirroring Controller management directory for each instance.

Note

  • Do not place the Mirroring Controller management directory in a directory managed by Fujitsu Enterprise Postgres, otherwise it may be deleted by mistake with the directories managed by Fujitsu Enterprise Postgres, and an old version of files may be restored.

See

  • Refer to "Preparing Directories for Resource Deployment" in the Installation and Setup Guide for Server for details on the directories that are managed by Fujitsu Enterprise Postgres.

  • Refer to "mc_ctl" in Reference for information on the command.

  • Refer to "Appendix A Parameters" for details on each parameter to be edited for the setup.

Perform the following procedure:

  1. Log in to the primary server.

  2. Create the Mirroring Controller management directory that will store the files required by database multiplexing.

    Use ASCII characters in the Mirroring Controller management directory.

    Additionally, grant "Write" permission to the instance administrator user for the Mirroring Controller management directory.

  3. In the network configuration file (network.conf), define the network configuration that will link between the Mirroring Controller processes.

    Create the network.conf file in the Mirroring Controller management directory, based on the sample file. For network.conf, set read and write permissions for the instance administrator user only.

    If users other than the instance administrator user are granted access, the mc_ctl command will not work. In this way, users other than the instance administrator user are prevented from operating Mirroring Controller.

    Sample file
    /installDir/share/mc_network.conf.sample

    In network.conf, specify the IP address or host name and port number of the primary server and standby server, and define the network configuration that will link between the Mirroring Controller processes, and between Mirroring Controller processes and the Mirroring Controller arbitration process.

    Refer to "A.3 Network Configuration File" for details.

    A definition example is shown below.

    The content to be defined depends on the operation settings at the time a heartbeat abnormality is detected.

    When automatic degradation by the arbitration server is selected
    Example)
    The IDs of the primary server and standby server are set to "server1" and "server2", and their port numbers are set to "27540" and "27541". The ID of the server of the Mirroring Controller arbitration process is set to "arbiter", and its port number is set to "27541".
    server1 192.0.2.100,192.0.3.100 27540,27541 server
    server2 192.0.2.110,192.0.3.110 27540,27541 server
    arbiter 192.0.3.120 27541 arbiter

    Ensure that the port numbers set for the primary server, standby server, and arbitration server do not conflict with other software. In addition, when the arbitration server is used for automatic degradation, use a network in which the arbitration network is not affected by a line failure in the admin network.

    When the server type is "server", two IP addresses or host names, and two port numbers need to be specified in the following order:

    • IP address or host name of the database server used as the admin network

    • IP address or host name of the database server used as the arbitration network

    • Port number of the database server used as the admin network

    • Port number of the database server used as the arbitration network

    If the server type is "arbiter", specify the IP address or host name set for the my_address parameter and the port number set for the port parameter in arbitration.conf of the arbitration server.

    When operation other than automatic degradation by the arbitration server is selected
    Example)
    The IDs of the servers are set to "server1" and "server2", and their port numbers are set to "27540".
    server1 192.0.2.100 27540
    server2 192.0.2.110 27540

    Ensure that the port numbers for the primary and standby server do not conflict with other software.

    Register in /etc/services the port number of the primary server, because programs such as WebAdmin use it to search for available port numbers.

    Register any name as the service name.

  4. Define the information related to Mirroring Controller monitoring and control in the serverIdentifier.conf file.

    Create the serverIdentifier.conf file in the Mirroring Controller management directory, based on the sample file.

    For serverIdentifier.conf, set read and write permissions for the instance administrator user only. If users other than the instance administrator user are granted access, the mc_ctl command will not work.

    As the file name for the serverIdentifier.conf file, use the server identifier name that was specified in the network.conf file in step 3.

    Sample file
    /InstallDir/share/mc_server.conf.sample

    Set the parameters shown in the table below in the serverIdentifier.conf file.

    Table 2.3 Parameters

    Parameter

    Content specified

    Remarks

    db_instance

    'dataStorageDestinationDir'

    Use ASCII characters, enclosed in single quotation marks (').

    db_instance_password

    'passwordOfInstanceAdminUser'

    If password authentication is performed, you must specify this parameter in the settings used when Mirroring Controller connects to a database instance. Use ASCII characters, enclosed in single quotation marks (').

    If the specified value of this parameter includes ' or \, write \' or \\, respectively.

    enable_hash_in_password

    on or off

    Specify on to treat the # in the db_instance_password specification as a password character, or off to treat it as a comment.

    The default is "off".

    syslog_ident

    'programName'

    Specify the program name to be used to identify the Mirroring Controller messages in the system log.

    Use ASCII characters excluding spaces, enclosed in single quotation marks (').

    Use the same program name as the parameter in the postgresql.conf file ensures that the Mirroring Controller output content can be referenced transparently, so log reference is easy.

    remote_call_timeout

    Admin communication timeout

    Specify the timeout value (milliseconds) of the Mirroring Controller agent process for communication between servers.

    Specify a value that is less than the operation system TCP connection timeout.
    Also, when using the Mirroring Controller arbitrage process for arbitrage, fencing, and state transition commands, specify a value that is greater than the sum of the timeout values.

    heartbeat_error_action

    Operation when a heartbeat abnormality is detected using operating system or server heartbeat monitoring

    arbitration: Perform automatic degradation using the arbitration server.

    command: Call a user exit to determine degradation, and perform automatic degradation if required.

    message: Notify messages.

    fallback: Perform automatic degradation unconditionally.

    Set the same value on the primary server and standby server.

    heartbeat_interval

    Interval time for abnormality monitoring during heartbeat monitoring of the operating system or server (milliseconds)

    Abnormality monitoring of the operating system or server is performed at the interval (milliseconds) specified in heartbeat_interval.

    This parameter setting is used as the default for database process heartbeat monitoring, streaming replication abnormality monitoring, and disk abnormality monitoring. When setting the monitoring time, there are some considerations to take into account to optimize degradation using abnormality monitoring. Refer to "2.11.4.1 Tuning for Abnormality Monitoring of the Operating System or Server" for details.

    heartbeat_timeout

    Timeout for abnormality monitoring during heartbeat monitoring of the operating system or server (seconds)

    heartbeat_retry

    Number of retries for abnormality monitoring during heartbeat monitoring of the operating system or server (number of times)

    fencing_command

    'fencingCmdFilePath'

    [Setting example]

    fencing_command = '/mc/fencing_dir/execute_fencing.sh'

    Specify the full path of the fencing command that fences a database server where an error is determined to have occurred.

    Enclose the path in single quotation marks (').

    This parameter must be specified when "command" is set for heartbeat_error_action.

    Specify the path using less than 1024 bytes.

    fencing_command_timeout

    Fencing command timeout (seconds)

    If the command does not respond within the specified number of seconds, fencing is determined to have failed and a signal (SIGTERM) is sent to the fencing command execution process.

    Specify a value between 1 and 2147483647.

    The default is 20 seconds.

    arbitration_timeout

    Timeout for arbitration processing in the Mirroring Controller arbitration process (seconds)

    The specified value must be at least equal to the heartbeat monitoring time of the operating system or server + fencing_command_timeout in the arbitration configuration file.

    If there is no response for at least the number of seconds specified, the primary server will not be switched and the standby server will not be disconnected. Therefore, perform degradation manually.

    Specify a value between 1 and 2147483647.

    This parameter does not need to be set for operation that does not use the arbitration server.

    arbitration_command

    'arbitrationCmdFilePath'

    [Setting example]

    arbitration_command = '/mc/arbitration_dir/execute_arbitration_command.sh'

    Specify the full path of the arbitration command to be executed when an abnormality is detected during heartbeat monitoring of the operating system or server.

    Enclose the path in single quotation marks (').

    This parameter must be specified when "command" is set for heartbeat_error_action.

    Specify the path using less than 1024 bytes.

    arbitration_command_timeout

    Timeout for arbitration command (seconds)

    If the arbitration command does not respond within the specified number of seconds, it is determined that execution of the arbitration command has failed and a signal (SIGTERM) is sent to the arbitration command execution process.

    Specify a value between 1 and 2147483647.

    This parameter can be specified only when "command" is set for heartbeat_error_action.

    Information

    Refer to "A.4.1 Server Configuration File for the Database Servers" for information on the parameters and for other parameters.