Skip to main content

Quick tutorial for replication agent

Quickly install, configure, and test your replication installation

This tutorial shows how to start a sample replication environment with a FairCom unmanaged replication agent. A replication agent is said to be unmanaged when it is not controlled by FairCom Replication Manager but acts as server thread dealing with the source server data. When not using the FairCom Replication Manager the configuration is up to the end user: this document shows the initial steps to create a sample replication environment. For simplicity both the servers are running on the same machine, of course a real replication environment is normally expected to run on different machines, in fact the sake of this tutorial is to familiarize with the unmanaged replication agent components. Please also consider that in this tutorial the unmanaged replication agent uses a special mode called Replication Agent Manager a special mode implemented to improve the threads management of the unmanaged replication agent: the Replication Agent Manager has slight differences in the way files are resynced and/or deployed to the target server.

  1. Install, configure, and start the primary server.

  2. Install the secondary server and configure it as follows:

    1. Add the following option to <faircom>\config\ctsrvr.cfg:

      PLUGIN ctagent;./agent/ctagent.dll
    2. Edit <faircom>\config\ctAgent.json to configure the agent as an unmanaged agent, and enable the replication agent manager.

      {
          "managed": false,
          "use_replication_agent_manager": true
      }
    3. Copy the following files from the <faircom>\drivers\ctree.c.replication\tutorials\config\secondary directory to the secondary server's <faircom>\config\ directory.

      ctreplagent.cfg
      deploy.cfg
      deployfilefilter.xml
      deployresyncfilelist.txt
      filefilter.xml
      resyncfilelist.txt
    4. Make the following changes in ctreplagent.cfg and deploy.cfg

      Change C:\faircomdb\primary\config to the configuration directory of your primary server
      Change C:\faircomdb\secondary\config to the configuration directory of your secondary server.
      Change FAIRCOMS to the server name and hostname of your source (primary) server.
      Change FAIRCOMT to the server name and hostname of your target (secondary) server.
      If your primary and secondary servers use different data directories, change the redirect option to the appropriate directory names. If the servers use the same directory name, remove the redirect option.
    5. Use the ctcmdset utility to create source and target authentication files and copy these files to the secondary server's configuration file directory.

  3. Start the secondary server.

  4. Create directories named subdir1 and subdir2 under the primary server's LOCAL_DIRECTORY.

  5. Create the test files on the primary server (replace user name, password, and server name with your settings):

    ctmtap fc mT mr aa hsubdir1\mark uADMIN pADMIN sFAIRCOMS@localhost
    ctmtap fc mT mr aa hsubdir2\mark uADMIN pADMIN sFAIRCOMS@localhost
  6. Edit and run the tutorial run_tutorial.bash example script. Script variables must first be edited to match your settings.

    ./tutorials/run_tutorial.bash <option>

    Where <option> is agent for the replication agent, source for the primary server, target for the secondary server.

Make your replication installation and configuration work properly

replicationinstallationconfigurationtest