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 Symfoware Server, otherwise it may be deleted by mistake with the directories managed by Symfoware Server, and an old version of files may be restored.
Start Mirroring Controller first, from the primary server. If it is started from the standby server, a switch will occur.
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 Symfoware Server.
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:
Log in to the primary server.
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.
In the network.conf file, 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.
Path of the sample file
installDir\share\mc_network.conf.sample
In the network.conf file, specify the host name (or IP address) and port number of the primary server and standby server, and define the network configuration that will link between the Mirroring Controller processes.
Refer to "A.3 Network Configuration File" for details.
A definition example is shown below.
In this example, the Mirroring Controller default port number 26540 is specified, and "server1" and "server2" represent any server identifiers.
Example)
server1 192.0.2.100 26540 server2 192.0.2.110 26540
Ensure that the port numbers for the primary and standby server do not conflict with other software.
Register the port number of the primary server in the services file, because there are programs, such as WebAdmin, that search an available port number using the services file.
Register any name as the service name.
Change the access permissions for the network.conf file.
In the network.conf file, set "Read" permission for the instance administrator user only.
If users other than the instance administrator user are granted access permissions, the mc_ctl command will not work. Accordingly, users other than the instance administrator user are prevented from operating Mirroring Controller.
Example) The following is an execution example, in which the instance administrator user is granted full access permissions as the owner when the operating system user name of the instance administrator user is "symfo". The following procedure applies when the user is logged in to the Windows server as "symfo":
> takeown /f network.conf > icacls network.conf /inheritance:r > icacls network.conf /grant symfo:F
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.
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.
Path of the sample file
installDir\share\mc_server.conf.sample
Set the parameters shown in the table below in the serverIdentifier.conf file.
Parameter | Content specified | Remarks |
---|---|---|
db_instance | 'dataStorageDestinationDir' | Use ASCII characters, and specify "\\" as the path delimiter. |
db_instance_service_name | 'registeredServiceNameOfSymfowareServerInstance' | Specify the registered service name of the Symfoware Server instance in the Windows service. Use ASCII characters to specify this parameter. |
db_instance_password | 'passwordOfInstanceAdminUser' | If password authentication is performed, specify this parameter in the settings used when Mirroring Controller connects to a database instance. Use ASCII characters to specify this parameter. |
mc_service_name | 'registeredServiceNameOfMirroringController' | Specify the Mirroring Controller service name registered in the Windows service. Use ASCII characters excluding forward slash (/) and backslash (\) to specify this parameter. The service name is up to 124 bytes. |
event_source | 'eventSourceName' | Specify the event source name to be used to identify the Mirroring Controller message in the event log. Use ASCII characters to specify this parameter. The maximum length of the event source name is 255 bytes. By using a similar event source name as the postgresql.conf file parameter, the Mirroring Controller output content can be referenced transparently, so log reference is easy. |
heartbeat_interval | 800 (milliseconds) | The time until an operation, such as the switch of the primary server, is performed after it was detected that there was no response, is calculated according to the following formula: (heartbeat_interval (milliseconds) + heartbeat_timeout (seconds)) * heartbeat_retry (count) = (0.8 + 1) * 2 = 3.6 (seconds) According to this setting, errors are monitored at 800-millisecond intervals, and if there were two successive occurrences when there was no response for a duration of one second, the operation to switch the primary server, or disconnect the standby server from the primary server, is performed. When setting this parameter, there are some considerations to take into account to optimize degradation using abnormality monitoring. Refer to "8.9.4 Tuning for Optimization of Degrading Operation Using Abnormality Monitoring" for details. |
heartbeat_timeout | 1 (second) | |
heartbeat_retry | 2 (count) |
Change the access permissions for the serverIdentifier.conf file.
In the serverIdentifier.conf file, set "Read" permission for the instance administrator user only. If users other than the instance administrator user are granted access permissions, the mc_ctl command will not work.
Example) The following is an execution example, in which the instance administrator user is granted full access permissions when the operating system user name of the instance administrator user is "symfo". The following procedure applies when the user is logged in to the Windows server as "symfo":
> takeown /f serverIdentifier.conf > icacls serverIdentifier.conf /inheritance:r > icacls serverIdentifier.conf /grant symfo:F
Configure the Windows firewall.
If the Windows firewall feature is to be enabled, you should enable the port number of Mirroring Controller that you specified in the network definition file in step 3. Refer to "C.2 Windows Firewall Settings" for details.
Register Mirroring Controller to the Windows service.
Execute the mc_ctl command in the register mode.
For the -P option of the mc_ctl command, specify the password of the operating system user who executes the command.
Example)
> mc_ctl register -M D:\mcdir\inst1 -w -f -P ********
Note
When specifying the password in the -P option of the mc_ctl command, for security reasons, you should be careful not to allow other users to access it.
Information
You can use the mc_ctl command with the -S option to specify automatic start and stop of Mirroring Controller. Refer to "8.10 Setting Automatic Start and Stop of Mirroring Controller and Multiplexed Instances" for details.
Using the service name specified in the mc_service_name parameter of the server definition file in step 5, Mirroring Controller is registered to the Windows service as shown below.
You can execute the sc qc command to check the registration status.