Skip to end of metadata
Go to start of metadata

 

Overview


For users who are new to replication, this document explains how to create and delete replication objects.

  • This document is written assuming that the user has completed the preliminary operation for replication structure or configuration.
  • This document is written assuming that the data is consistent between the target servers for replication. Either all of the data exist the same, or both are zero.

 

Version


Altibase version 4.3.9 or later

 

Preparation


  • Dedicated IP for replication
    It is recommended to use a dedicated line separate from the service network for the IP to be used for replication.
  • Replication service port
    Set the service port number for replication. It can be arbitrarily set by the user, and 30300 is generally used.
  • Select the target table for replication
    The table to be replicated must have a primary key.

 

Enabling the replication function


  • Altibase server's replication function is disabled by default,

  • To use the replication function, the user must enable it by changing the relevant properties.
  • Enabling the replication function requires restarting the Altibase server.

Changing REPLICATION_PORT_NO property

  • Replication is enabled by changing the value of the Altibase server property REPLICATION_PORT_NO.
  • The REPLICATION_PORT_NO property also means the port number to be used between replication threads.
  • The port number is not used by the server and is arbitrarily assigned by the user, and 30300 is also used in general.
  1. Check if the replication port specified by the user is in use on the replication target server.

  2. Open the altibase.properties file, change the REPLICATION_PORT_NO value, and save it. This must be done on each of the replication target servers.

  3. Restart the Altibase server process.

     Click here to expand...

    In order to block access to the application during the process of creating a replication object, change the Altibase server service port and restart it.

  4. After starting the Altibase server, check the replication port LISTEN status and property settings.

 

Creating replication object


  • Replication objects are created with the CREATE REPLICATION statement and define information related to replication such as replication mode, replication server information, and replication target table.
  • Two servers to be replicated are paired.
  • Replication objects must each be created with the same object name on the paired replication server.

    For creating replicaiton object
  • Refer to Replication Manual -> 3. Using Replication -> Create Replication (CREATE REPLICATION) for additional options of the replication object creation syntax.
  • Manual page: http://support.altibase.com/en/manual 

 

 Procedure for creating replication objects-Example 1 (when there are 2 replication target servers)

This is an example of creating a replication object when the conditions for creating a replication object are as follows.

  • The target server for replication is two A and B servers.
  • The replication object name is created as REP1.
  • The IP address of the target server A is 192.168.1.112 and the port number is 25524.
  • The IP address of the target server B is 192.168.1.113 and the port number is 35524.

  • The target tables for replication are the SYS user's employees table and departments table.
  1. Server A: IP 192.168.1.112, replication port: 25524

  2. Server B: IP 192.168.1.113, replication port: 35524

     

     

  3. Check whether the replication object was created

    Check on replication target server A
    Check on replication target server B
 Procedure for creating replication objects-Example 2 (when there are 3 replication target servers)

 This is an example of creating a replication object when the conditions for creating a redundant replication are as follows.

  • The target servers for replication are A, B, and C
    A is B, C and
    B is A, C and
    C synchronizes with A and B with each other.
  • The name of the replication object is determined as follows.
    -REP_A_B for servers A and B
    -REP_B_C for servers B and C
    -REP_C_A for A and C servers

  • The IP address and replication port number of each server are as follows.
    -Server A: 192.168.1.112, 30300
    -Server B: 192.168.1.113, 30300
    -Server C: 192.168.1.114, 30300

  • The target tables for replication are the SYS user's employees table and departments table.
  1. A Server : IP 192.168.1.112 , Replication port: 30300

  2. B Server : IP 192.168.1.113 , Replication port: 30300

  3. C Server : IP 192.168.1.114, Replication port: 30300

  4. Check whether the replication object was created

    Check on replication target server A
    Check on replication target server B
    Check on replication target server C

 

Starting replication


  • Starting replication means starting the data synchronization.
  • The server that started the replication starts the replication sender thread, and the remote server paired with the server starts the receive thread.
  1. Selecting the replication start server (active server)
    The server that starts the replication and the server that runs the replication sender refers to the server where the change transaction occurs and is also called the active server.
    Among the replication target servers in a pair, the place where data change occurs is the active server, and the other server becomes the standby server.
    If a change transaction occurs on both servers and synchronizes in both directions, both servers become active servers.
  2. Start of replication
    The active server starts replication with the ALTER REPLICATION statement. replication_name is the name of the object created in the replication object creation step.

  3. Check the status of starting/running replication
    This is a statement to check whether the replication sending thread (Sender) and receiving thread (Receiver) are running.

    How to check the starting status of the replication sender thread (Sender) of the replication start server and active server
    How to check the running status of the replication receiving thread (Receiver)



Deleting replication object


This section describes how to delete replication objects.

 

Error messages


Here are some of the error messages that may occur during the process of creating replication objects.

[ERR-61023 : Replication is disabled]

  • This is an error message that can be encountered when executing the CREATE REPLICATION statement. It occurs when the replication function is disabled
  • Check the value of the REPLICATION_PORT_NO property. Refer to the section on enabling the replication function.

 

[ERR-61113 : A replicated table must have a primary key. (user_name.table_name)]

  • This is an error message that may occur when executing the CREATE REPLICATION statement.
  • This occurs when there is no primary key in the replication target table specified in the FROM clause.
  • At the end of the error message, a primary key needs to be created in the table inside () and perform a duplicate object creation statement.

[ERR-6100D : [Sender] Failed to handshake with the peer server (Handshake Process Error)]

  • This is an error message that may occur when ALTER REPLICATION replication_name START is executed.
  • Check if the remote server's IP and redundancy port number entered in the WITH clause are correct, and that access to the corresponding IP and port is possible.


Reference Documents

 


 

  • No labels