This section explains how to create, set, and register the primary server instance.
Note
When database multiplexing mode is used, the server command cannot be used together with WebAdmin.
Additionally, instances that run in database multiplexing mode cannot be accessed from WebAdmin, even if the database multiplexing mode is stopped and operations are changed to single server mode.
See
Refer to "Client Authentication" in the PostgreSQL Documentation for information on the pg_hba.conf file.
Refer to "B.1 Parameters Set on the Primary Server" for information on the postgresql.conf file.
Refer to "mc_ctl" in Reference for information on the command.
Perform the following procedure:
Refer to "Setup" in the Installation and Setup Guide for Server, and then perform the Symfoware Server setup and create the Symfoware Server instance.
Use ASCII characters excluding spaces in the data storage destination directory.
Configure the encryption settings for the storage data.
Create the keystore file.
Refer to "Database Multiplexing Mode" in the Operation Guide for details, and then configure the settings.
To connect from the primary server to the standby server to send the transaction logs, add the following entries to the pg_hba.conf file:
Copy the file to the standby server later.
# TYPE DATABASE USER ADDRESS METHOD host replication symfo standbyServerAddress authenticationMethod host replication symfo primaryServerAddress authenticationMethod
For the primary and standby server addresses, specify the IP address that will connect to the log transfer network.
Additionally, all servers can be used as the primary server or the standby server, so add entries for the addresses of all servers that comprise the database multiplexing system.
As the authentication method, set a method other than trust authentication.
So that authentication can be performed automatically, in the home directory of the instance administrator user, create the .pgpass file and then specify a password for the replication database.
Accordingly, the OS user account of the instance administrator user and the user registered in the database will be the same, so you can verify that the connection was not made by an unspecified user. Additionally, the password that was set beforehand will be used in the authentication, so that the connection will be automatic.
When building the standby server, each option of the mc_ctl command setup mode must match the user name and password specified in the .pgpass file.
Note
If trust authentication is set, all OS users who can log in to the primary server will be able to connect, and if one of these is a malicious user, then that user can corrupt the standby server data, or cause the job system to fail, by sending an erroneous transaction log. Refer to "Authentication Methods" in the PostgreSQL Documentation for details on the authentication methods that can be set.
Configure this setting to enable the instance administrator user of the primary server to connect as a database application.
This setting enables the connection to the instance using the user name of the instance administrator user, so that Mirroring Controller can monitor instance errors. Configure this setting to enable the connection to the postgres database.
As the authentication method, set a method other than trust authentication.
If password authentication is used
In the db_instance_password parameter of the serverIdentifier.conf file, specify the password for the instance administrator user. This password is used to connect to the database instance. If a password is not specified in the db_instance_password parameter, the connection to the database instance from Mirroring Controller will fail, and it will not be possible to perform the process monitoring of the instance.
If password authentication is not used
There is no need to specify the password in the db_instance_password parameter.
Even if the password for the instance administrator user is specified in the db_instance_password parameter, it will be ignored.
An example of setting the authentication method is shown below.
# TYPE DATABASE USER ADDRESS METHOD
host postgres symfo 127.0.0.1/32 authenticationMethod
Refer to the note in step 3 for notes relating to trust authentication.
To use database multiplexing mode, specify the parameters shown in the table below in the postgresql.conf file.
The postgresql.conf file is copied when the standby server instance is created. Accordingly, set the required parameters in the standby server.
To use database multiplexing mode, specify the parameters shown in the table below in the postgresql.conf file. After editing the postgresql.conf file, restart the instance.
Parameter | Content specified | Remarks |
---|---|---|
wal_level | Literal "hot_standby" | |
max_wal_senders | Number of standby servers + 1 | The number of standby servers (n) is 1, so 2 must be specified. |
synchronous_standby_names | 'standbyServerName' | Specify the name that will identify the standby server. Enclose the name within single quotation marks ('). The value specified for this parameter must also be specified in the --standby-names parameter when the mc_ctl command is executed in setup mode. Do not change this parameter while Mirroring Controller is running. |
hot_standby | on | Specify this to execute reference jobs on the standby server. (*1) |
wal_receiver_status_interval | Time interval (seconds) | This value must be smaller than the value set for replication_timeout in the postgresql.conf file of the primary server. |
wal_keep_segments | Number of file segments | If a delay exceeding the value set in this parameter occurs, the WAL segment required later by the primary server may be deleted. Additionally, if you stop a standby server (for maintenance, for example), consider the stop time and set a value that will not cause the WAL segment to be deleted. Setting this parameter requires consideration regarding stabilization of the database multiplexing mode (refer to "6.9.1 Tuning to Stabilize the Database Multiplexing Mode" for details). Refer to "Estimating Transaction Log Space Requirements" in the Installation and Setup Guide for Server for information on estimating the WAL segment. |
replication_timeout | Timeout (seconds) | Specify the time period after which it is determined that an error has occurred in the transaction log transfer. By aligning this value with the value of (heartbeat_interval + heartbeat_timeout) x heartbeat_retry of the serverIdentifier.conf file, you can unify the time after which it is determined that an error has occurred. |
archive_mode | on | Specify the archive log mode. |
archive_command | 'installDir/bin/pgx_xlogcopy.cmd "%p" "backupDataStorageDestinationDirectory/archived_xlog/%f"' | Specify the command and storage destination to save the transaction log. |
backup_destination | Backup data storage destination directory | Specify the name of directory where to store the backup data. Set the privileges so that only the instance administrator user can access the specified directory. Specify the same full path on all servers, so that the backup data of other servers can be used to perform recovery. |
max_connections | The limit value for the number of standby server connections + number of simultaneous executions of mc_ctl status (*2) + 2 + number of simultaneous client connections to the instance + superuser_reserved_connections | The value specified is also used to restrict the number of connections from client applications and the number of connections for the management of instances. Refer to "When an Instance was Created with the initdb Command" in the Installation and Setup Guide for Server, and "Connections and Authentication" in the PostgreSQL Documentation, for details. |
*1: Used in the Mirroring Controller option feature.
*2: Number of simultaneous executions of the mc_ctl command in the status mode.
Start the Mirroring Controller process.
As the instance administrator user, execute the mc_ctl command in start mode with the -f option specified. This enables automatic switch or disconnection.
If you start Mirroring Controller and the instance without specifying the -f option, automatic switch and disconnection will not be enabled. To enable both, start Mirroring Controller and then execute the mc_ctl command in enable-failover mode, or restart Mirroring Controller with the -f option specified.
Example)
$ mc_ctl start -M /mcdir/inst1 -f
As the instance administrator user, execute the mc_ctl command in start mode.
Example)
$ mc_ctl start -M /mcdir/inst1
Obtain the backup.
Use the pgx_dmpall command to collect the backup.