Product Documentation

Clustering for Scalability and Availability

Previous Topic

Next Topic

Global Distributed Read Scalability

In this chapter you will learn how to use asynchronous replication to replicate an entire database or subsets of it across many remote servers and clients, horizontally scaling the data to support very large numbers of read-only users.

For more information, see Global Distributed Read Scalability in Use Cases for FairCom Replication.

Preparation

To prepare for this tutorial, ensure that:

  • One FairCom Replication Manager Server has been set up.

    (see Replication Manager Server Setup)

  • Six FairCom Servers have been set up, including five as read-only, and that these servers appear in Replication Manager.

    (see FairCom Server Setup)

    For this tutorial we will model replication across FairCom Servers in three separate data centers: Datacenter1, Datacenter2, and Datacenter3. These data centers will be represented in vertical columns in Replication Manager.

The following steps show how to implement a replication plan in Global Distributed Read Scalability mode with FairCom Server V12 zip packages. These steps apply to setting up replication between any FairCom Server types: FairCom DB, FairCom Edge, and c-treeRTG.

Connect to Replication Manager

  1. In a web browser, navigate to https://<ReplicationManagerHostName>:19992/
  2. Select Replication Manager.
  3. In the Connection Options dialog, enter appropriate credentials click Connect.

    (Shown below is the view with six servers, the orange two are read only, which result from the common setup steps above.)

Set FairCom Servers to Read-Only

Set five of the FairCom Servers to be read-only by doing the following:

  1. Ensure the line below is present (and uncommented) in the config/ctsrvr.cfg file:

    READONLY_SERVER YES

    The view in Replication Manager should now look similar to the following:

    Note: Displayed server names can be changed in the Replication Manager UI by right clicking on the server and selecting "Edit Server Replication Management Info". Changes made here will only affect the name displayed in this UI, not the actual host or FairCom Server name.

Create a Test Table

Connect FairCom SQL Explorer to the first FairCom Server by doing the following:

  1. In a web browser, navigate to https://<ReplicationManagerHostName>:19992/
  2. Select FairCom SQL Explorer.
  3. In the Connect to Server and Database dialog, enter the Hostname (or IP address) and Port Number (19791) for the first FairCom Server.
  4. With appropriate credentials entered click Connect to Server.

  5. Right-click on Tables and select Create New Table:

  6. Populate the table schema and create a new table:

  7. Click Create. A modal window will say “Table Successfully Created”. Click OK to exit that window.

Set a Replication Plan

Set up a replication plan to multiple FairCom Servers within a data center.

(Below, each column of orange read-only servers represents a different data center)

  1. In Replication Manager, right-click on the replication-source FairCom Server (where a table was just created) and select Create New Publication.

  2. Check the Published check box for the table just created and click Save & Close:

  3. Create a Replication Plan between the source server and the destination servers by dragging and dropping a line from the Source to the Destination. For each line connecting a Source and Destination Server, a Replication Plan will be created and the following dialog will be displayed:

  4. Click Subscribe for the publication just created:

  5. Click Save, subscribing with default options:

  6. Click Close to finalize the Replication Plan creation:

    Follow the steps above to create a Replication Plan between the Source Server (light blue) and another destination server (FairCom5 in view below):

    Note: ReplPlan2 can use the same publication as ReplPlan1.

  7. Right-click over both Replication Plan lines just created and select Deploy:

    At this point, the Replication Plan deployment will execute the following actions:

    • It will copy the published files over to the Destination servers.
    • It will start the replication process, keeping the destination servers in sync with the source.

  1. Set up additional replication plans from the read-only servers in the first datacenter to the servers in the second datacenter. (i.e. FairCom2 @ DataCenter1 to FairCom3 @ DataCenter2 and FairCom4 @ Datacenter1 to FairCom5 @ Datacenter2):

    Note that setting up a Replication Plan must be done from a source server with data already on the server. In the example below, Replication Plans need to be set up in left-to-right order.

  2. Drag a line from a read-only server in Datacenter1 to a server in Datacenter2 in order to create a Replication Plan between them. The new Replication Plan dialog should be displayed:

  3. Click Create New Publication to bring up the publication editor:

  4. The table should be listed (typically prepended with “<username>_”). If the table is not listed, go back to step 3 and check your work. Ensure the Published option is checked and click on Save & Close:

  5. The new publication should be listed in the left panel. Click Subscribe:

  6. Click Save to create the subscription based on the default options:

  7. Click Close to confirm the Replication Plan creation:

  8. Create and deploy replication plans for the remaining servers. The final result should look similar to the following:

Replication is now live and scaled between multiple servers in multiple data centers. Additional tables and servers can be added as needed.

TOCIndex