Usage and configuration
In this chapter we’re going to setup an asynchronous data replication between two c-tree servers.
Transaction logging required
The c-tree replication feature relies on a transaction log based facility. Your files must be under transaction control to take advantage of c-tree replication.
Transaction logging can be applied to existing files using the
-tron option of the
ctutil utility.
Shutdown the c-tree servers
It’s good practice to stop the involved c-tree servers before proceeding with the steps discussed below.
Prepare the Source
No particular operation is required on the Source c-tree server. Just be sure that the installed license allows replication features.
Prepare the Target
Be sure this second c-tree server resides in its own directory and has a
SERVER_NAME different than the name of the Source c-tree server.
1. Edit config/ctsrvr.cfg and activate the ctagent plugin by removing the semicolon:
Windows
PLUGIN ctagent;./agent/ctagent.dll |
Linux/Unix
PLUGIN ctagent;./agent/libctagent.so |
2. move config/replication/ctagent.json to config/ctagent.json, replacing the destination file,
3. replace the content of config/ctagent.json with this code:
{ "detached": true, "configurationFileList": [ "../config/replication/ctreplagent1.cfg" ]} |
4. edit config/replication\ctreplagent1.cfg to add the following line
replicate_data_definitions yes |
5. edit config/replication/ctreplagent1.cfg
a. replace "SourceIP" with the source machine host name in the following line:
source_server FAIRCOMS@SourceIP |
b. replace "localhost" with the target machine host name in the following line:
target_server FAIRCOMS@localhost |
6. edit config\replication\filter1.xml and replace ".\ctreeSQL.dbs\admin_test.dat" with "*.dat" as follows:
<file status="include">*.dat</file> |
7. copy existing c-tree files from the Source server to the Target server
Testing the Repliaction Agent
After the above steps, start (or restart) the c-tree servers.
When both Source and Target c-tree servers are up and running, you can start editing the c-tree files on the Source server. Every modification will be replicated to the corresponding files on the Target server.