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. For example, you can leave the default name "FAIRCOMS" in the Source c-tree server and use the name "FAIRCOMT" for the Target c-tree server.
1. Edit config/ctsrvr.cfg
a. provide a different SERVER_NAME, e.g. replace
with
b. activate the ctagent plugin by removing the leading semicolon that comments the line out:
Windows
PLUGIN ctagent;./agent/ctagent.dll |
Linux/Unix
PLUGIN ctagent;./agent/libctagent.so |
2. replace the content of config/ctagent.json with this code:
{ "detached": true, "configurationFileList": [ "../config/replication/ctreplagent1.cfg" ]} |
3. edit config/replication/ctreplagent1.cfg
a. replace "SourceIP" with the source machine host name in the following line:
source_server FAIRCOMS@SourceIP |
b. replace "FAIRCOMS" with "FAIRCOMT" in the following line:
target_server FAIRCOMS@localhost |
4. edit config\replication\filter1.xml and replace ".\ctreeSQL.dbs\admin_test.dat" with "*.dat" as follows:
<file status="include">*.dat</file> |
5. edit config\replication\source_auth.cfg changing the PASSWD value to "ADMIN":
6. edit config\replication\target_auth.cfg changing the PASSWD value to "ADMIN":
7. open a command prompt
a. change to the config\replication directory
b. run these commands to generate the new source_auth.set and the new target_auth.set:
../../tools/ctcmdset source_auth.cfg ../../tools/ctcmdset target_auth.cfg |
8. copy existing c-tree files from the Source server to the Target server
Testing the Replication 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.