LOGMIRROR

LOGMIRROR

LOGMIRROR is a replication tool which copies the redo logs generated by GOLDILOCKS to the remote location for the configuration of the same redo log file.

Overview

CYCLONE, using the CDC method, analyzes and replicates the redo log file generated during the operation of GOLDILOCKS. Therefore, if the operating server is failed when analysis of the redo log file is not completed, then unanalyzed redo log file is not replicated and the data is lost.

However, if the redo logs are sent to a remote location without data loss and the redo log file is configured by using LOGMIRROR, then this problem of CYCLONE can be solved.

LOGMIRROR is a tool for eliminating the data loss which is caused because CYCLONE uses the ASYNC method, and it should work together with CYCLONE.

Operational Features

Performance Degradation Factors of GOLDILOCKS When Operating LOGMIRROR

LOGMIRROR sends the redo logs generated by GOLDILOCKS to the remote location before storing them in the file, then processes the next after it is normally processed. Therefore, the network speed between the replication devices is an important factor of the performance, and it can cause performance degradation than GOLDILOCKS operated without LOGMIRROR. However, the high speed infiniband is supported to minimize the performance degradation.

Requirements

GOLDILOCKS Requirement

The following should be set in GOLDILOCKS before performing LOG MIRROR.

LOG_MIRROR_MODE

The LOG_MIRROR_MODE property is set to use LOGMIRROR in GOLDILOCKS. When it is activated, the resources which temporarily store the redo logs generated by GOLDILOCKS before LOGMIRROR sends them to a remote location are allocated.

Or, the following statement is executed in gSQL.

gSQL> ALTER SYSTEM SET LOG_MIRROR_MODE=1 SCOPE=FILE;

System altered.

LOG_MIRROR_SHARED_MEMORY_STATIC_SIZE

LOG_MIRROR_SHARED_MEMORY_STATIC_SIZE sets the temporary storage space used by LOGMIRROR.

Or, the following statement is executed in gSQL.

gSQL> ALTER SYSTEM SET LOG_MIRROR_SHARED_MEMORY_STATIC_SIZE = 200M SCOPE=FILE;

System altered.

LOG_MIRROR_TIMEOUT

When interworking with LOGMIRROR, GOLDILOCKS includes the step of waiting for the response from LOG MIRROR. Too slow response causes the degradation of GOLDILOCKS performance. LOG_MIRROR_TIMEOUT sets the response time so when there is not any response after the time is over, LOGMIRROR stops the service, but only the GOLDILOCKS continues the service.

When restarting LOGMIRROR to perform LOGMIRROR again, it is normally operated after the recovery process.

Or, the following statement is executed in gSQL.

gSQL> ALTER SYSTEM SET LOG_MIRROR_TIMEOUT = 20;

System altered.

The GOLDILOCKS requirements for operating CYCLONE should also be applied.

Configuration

Configuration File

The information and options required for the operation can be set by using the configuration file when executing LOGMIRROR.

Configuration contents

Name

Description

Coverage

PORT

It sets the port to be used for the communication between master and slave.

Master/ slave

DSN

It sets Data Source Name.

Master

HOST_IP

It sets the host IP address which is operated by GOLDILOCKS.

Master

HOST_PORT

It sets the host port which is operated by GOLDILOCKS.

Master

USER_ID

It sets the user name.

Master

USER_PW

It sets the user password.

Master

USER_ENCRYPT_PW

It sets encrypted user password.

Master/ slave

LOG_PATH

It sets the path in which the replicated redo log file is to be stored.

Slave

MASTER_IP

It sets the IP address of the device which is being operated by the log mirror master.

Slave

HEARTBEAT_TIMEOUT

It sets the maximum time (second) maintaining connection if the connection is not smooth due to network disconnection or system error after replication connection.

Master/ slave

TCP_NODELAY

It sets TCP_NODELAY option of a socket. (The default value is 1.)

  • 0: TCP_NODELAY off

  • 1: TCP_NODELAY on

Master

Configuration Options

PORT

PORT=21106

DSN

DSN = GOLDILOCKS

HOST_IP

HOST_IP = 127.0.0.1

HOST_PORT

HOST_PORT = 22531

USER_ID

USER_ID = testID

USER_PW

USER_PW = testPW

USER_ENCRYPT_PW

USER_ENCRYPT_PW = 't33KImiqvhqNyfN+uZmFrw=='

LOG_PATH

LOG_PATH = '/data/wal'

MASTER_IP

MASTER_IP = 192.168.0.100

HEARTBEAT_TIMEOUT

HEARTBEAT_TIMEOUT = 40

TCP_NODELAY

TCP_NODELAY = 1

Operating

The executing environment of master/ slave of LOGMIRROR is as follows.

Executing environment

Item

Whether to

operate

GOLDILOCKS

Description

Master

O

When operating as master, LOGMIRROR should be operated at the device in which GOLDILOCKS is operated.

Slave

X

When operating as slave, GOLDILOCKS is not required to be operated and the storage space in the disk is required to store the redo log file.

The operating contents during the execution can be viewed through a trace log.

Item

File

Master

$GOLDILOCKS_DATA/trc/LogMirror_master.trc

Slave

$GOLDILOCKS_DATA/trc/LogMirror_slave.trc

For more information about the error messages and handlings stored in the trace log, refer to Troubleshooting for LOGMIRROR.

Operating LOGMIRROR

LOGMIRROR can normally replicates the redo log file only when the following procedures should be completed even after the GOLDILOCKS configuration, initializing and operating master/ slave.

SWITCH of the redo log file should occur to start the replication. LOGMIRROR starts the normal operation after generating the new log file. Therefore, the following step should be performed.

gSQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

The redo log file replicated by LOGMIRROR is continuously stored, and it is not automatically deleted. Therefore, the file management such as deleting or moving is regularly required according to the environment of the operating device.

Executing Option

Execution options

Option

Description

Remarks

--start | -s

It executes LOGMIRROR.

It should be used together with --master | --slave.

--stop | -t

It terminates LOGMIRROR.

It should be used together with --master | --slave.

--master | -m

It is performed in master mode.

It should be used together with --start | --stop.

--slave | -l

It is performed in slave mode.

It should be used together with --start | --stop.

--conf | -c

It sets the configuration file path.

It is input in --conf CONFIG_FILE format.

--infiniband | -f

It uses infiniband network environment.

It is not input when using TCP/IP environment.

--silent | -i

It sets not to output the message.

-

--help | -h

It sets to output the help message.

-

prompt> logmirror --master --start
prompt> logmirror --master --stop
prompt> logmirror --slave --start
prompt> logmirror --slave --stop
prompt> logmirror --master --start --conf TEST_CONFIG --infiniband
prompt> logmirror --slave --start --conf TEST_CONFIG --infiniband

For examples of initializing LOGMIRROR, refer to LOGMIRROR.

Examples of Interworking with CYCLONE

Interworking of CYCLONE, the CDC replication tool, with LOGMIRROR, the replication tool of the redolog file, eliminates the risk of data loss.

Tool

Function

Interworking

CYCLONE

Replication of CDC

If it is independently operated it may cause the data loss.

LOGMIRROR

Replication of REDO LOG FILE

If it is operated together it does not cause the data loss.

The following describes the examples of interworked operation, and its structure.

Example of operating structure

Example of operating structure

Operating Order

  1. Set the configuration of CYCLONE and LOGMIRROR in the original GOLDILOCKS.

  2. Set the configuration of LOGMIRROR MASTER/SLAVE.

  3. Execute LOGMIRROR MASTER/SLAVE.

  4. Perform LOG FILE SWITCH of the original GOLDILOCKS for the normal operation of LOGMIRROR.

  5. Set the remote GOLDILOCKS configuration.

  6. Set the CYCLONE MASTER/SLAVE configuration.

  7. Execute CYCLONE MASTER/SLAVE.

Configuring CYCLONE and LOGMIRROR in Original GOLDILOCKS

Refer to the following.
• CYCLONE configuration: Requirements
• LOGMIRROR configuration: Requirements

Create the tables T1, T2 for a test after the configuration.

gSQL > CREATE TABLE T1( COL1 INTEGER PRIMARY KEY, COL2 VARCHAR(20) );
gSQL > CREATE TABLE T2( COL1 INTEGER PRIMARY KEY, COL2 VARCHAR(20) );
gSQL > COMMIT;

Configuring LOGMIRROR MASTER/SLAVE

LOG MIRROR MASTER should be operated on the device in which the original GOLDILOCKS is operated.

HOST_IP   = 192.168.0.10
HOST_PORT = 22581
USER_ID = cdc_user
USER_PW = cdc_password
PORT = 21106
MASTER_IP = 192.168.0.10
PORT = 21106
LOG_PATH = '/data/LogMirrorWAL'

Executing LOGMIRROR MASTER/ SLAVE

logmirror --master --start --conf $GOLDILOCKS_DATA/conf/logmirror.master.conf
logmirror --slave --start --conf $GOLDILOCKS_DATA/conf/logmirror.slave.conf

Executing LOGFILE SWITCH of Original GOLDILOCKS for Normal Operation of LOGMIRROR

gSQL> ALTER SYSTEM SWITCH LOGFILE;

When it is executed as above, the redo log file is generated in the path set in the SLAVE device. If the redo log file is not generated, a user should check the directory privilege or check whether the directory is created.

Configuring Remote GOLDILOCKS

It is required to check the table configuration for the normal operation and replication of GOLDILOCKS operated on the target device, and check the schema information.

The tables T1, T2 are created for test as follows.

gSQL > CREATE TABLE T1( COL1 INTEGER PRIMARY KEY, COL2 VARCHAR(20) );
gSQL > CREATE TABLE T2( COL1 INTEGER PRIMARY KEY, COL2 VARCHAR(20) );
gSQL > COMMIT;

Configuring CYCLONE MASTER/ SLAVE

HOST_IP   = 192.168.0.10
HOST_PORT = 22581
USER_ID = cdc_user
USER_PW = cdc_password

GROUP_NAME = GROUP1
{
    PORT = 21102
    CAPTURE_TABLE = 
    (
        T1,
        T2
    )
}
USER_ID = cdc_user
USER_PW = cdc_password
MASTER_IP = 192.168.0.20

GROUP_NAME = GROUP1
{
LOG_PATH = '/data/LogMirrorWAL'
    PORT = 21102
    APPLY_TABLE =
    ( 
        T1 TO T1,
        T2 TO T2
    }
}

Executing CYCLONE MASTER/ SLAVE

cyclonet --master --start --conf $GOLDILOCKS_DATA/conf/cyclone.master.conf
cyclone --slave --start --conf $GOLDILOCKS_DATA/conf/cyclone.slave.conf