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.
Check if the replication port specified by the user is in use on the replication target server.
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.
Restart the Altibase server process.
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
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.
- 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. 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.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 serverHow 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
- Replication Manual
- SQL Reference
- Download manual page: http://support.altibase.com/en/manual
- Github: https://github.com/ALTIBASE/Documents/tree/master/Manuals/