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.
Start the Replication Manager (Memphis)
To start the Faircom’s Replication Manager, change to the folder “replication.manager/replicationmanager” and run the command:
After a successful startup, the Faicom’s Replication Manager listens for standard HTTP connections on the port 8080 and for secure HTTP connections on the port 8443.
Note - The default ports can be changed by editing the cthttpd.json file under the “replication.manager/replicationmanager/config” folder.
Configure the c-tree servers
The involved c-tree servers must have different names and have the necessary plugins enabled.
The following actions should be performed on the involved c-tree servers:
1. Edit config/ctsrvr.cfg:
a. be sure that the SERVER_NAME entry in this configuration file uses a different value than the SERVER_NAME entry in the other configuration files. For example, you could name the first server FAIRCOMS1 and the second server FAIRCOMS2;
b. activate the ctagent plugin and the httpd plugin by removing the leading semicolon that comments the lines out:
Windows
PLUGIN cthttpd;./web/cthttpd.dll PLUGIN ctagent;./agent/ctagent.dll |
Linux/Unix
PLUGIN cthttpd;./web/libcthttpd.so PLUGIN ctagent;./agent/libctagent.so |
2. replace the content of replication.manager/replicationmanager/config/ctagent.json with this code:
{ "embedded": true, "log_file": "agentLog.txt", "memphis_server_name": "MEMPHIS", "memphis_sql_port": 7000, "memphis_host": "localhost", "memphis_database": "MEMPHIS", "ctree_check_mask": "*.dat;*.idx;*.fdd;*.fsd", "inactive_timeout": 600 } |
Note - "memphis_host" has to be set with the appropriate IP address of the machine where the Memphis is running.
3. replace the content of replication.manager/replicationmanager/config/cthttpd.json with this code:
Windows
{ "listening_http_port": 8080, "listening_https_port": 8443, "ssl_certificate": "./web/fccert.pem", "document_root": "./web/apps", "applications": [ "ctree;ctREST.dll", "AceMonitor;ctMonitor.dll", "SQLExplorer;ctSQLExplorer.dll", "ISAMExplorer;ctISAMExplorer.dll", "ReplicationManager;ctReplicationManager.dll" ] } |
Linux/Unix
{ "listening_http_port": 8080, "listening_https_port": 8443, "ssl_certificate": "./web/fccert.pem", "document_root": "./web/apps", "applications": [ "ctree;libctrest.so", "AceMonitor;libctmonitor.so", "SQLExplorer;libctsqlexplorer.so", "ISAMExplorer;libctisamexplorer.so", "ReplicationManager;libctReplicationManager.so" ] } |
Start the c-tree servers
After being configured, the c-tree servers can be started.
Use the Replication Manager web utility to configure and monitor the replication
Using a web-browser, browse to http://localhost:8080/ReplicationManager.
Use the IP address of the server where Memphis is running instead of "localhost" if you’re connecting from a remote machine.
An overview of available c-tree servers is presented:
To create a replication between two servers, hover over the edge of the source server: a chain-link appears. Drag from the source server and drop on the target server:
The following dialog appears:
Click Create New Publication and use the Replication Wizard to create a Publication.
The Publication includes the folders and files on the source server to be replicated.
You can optionally exclude specific files:
In the end, a summary is shown:
Click Finish to confirm.
The Publication is now available:
Click Subscribe to make a Subscription.
The Subscription is the replication destination on the target server.
The Subscription Options dialog allows you to change the destination folder of the Target server and setup a Bidirectional replication.
The replication plan is now available and can be managed in the "Existing Plans" section of the Replication Manager:
Click the arrow button next to a plan and click Deploy to deploy it, then click Start to begin replication.
The connection between the c-treeRTG Servers becomes green when the deploy task completes successfully:
Click the arrow button next to a plan and click Activity to have a summary of the work that was performed. The summary looks like this: