Loading TOC...
Flexible Replication Guide (PDF)

Flexible Replication Guide — Chapter 2

Flexible Replication Quick Start

This chapter provides the quick-start procedures for creating a simple flexible replication configuration on a single MarkLogic Server. Typical flexible replication configurations will have the Master and Replica databases on different MarkLogic Servers located on different hosts. Replicated MarkLogic Servers may reside in the same cluster or in different clusters. In order to keep the hardware requirements to a minimum, this quick start describes how to set up replication between two databases on the same MarkLogic Server.

This chapter includes the following sections:

All of the procedures described in this chapter are done using the Admin Interface described in the Administrative Interface chapter in the Administrator's Guide.

Creating Master and Replica Databases

Before attempting to configure replication, create a Master and a Replica database. In these examples, the databases are named Master and Replica. However, you can use any name you wish for either the master or its replica.

  1. Create two forests, one for the Master database and one for the Replica database. For details on creating forests, see Creating a Forest in the Administrator's Guide.
  2. Create two databases, Master and Replica, and attach the respective forest to each database. For details on creating databases and attaching forests, see Creating a New Database and Attaching and/or Detaching Forests to/from a Database in the Administrator's Guide.

Configuring a Flexible Replication Pipeline for the Master Database

This section describes how to configure the Content Processing Framework (CPF) for the replicated domains on the Master database. In order to replicate data, CPF on the Master domains must be configured with the Status Change Handling and Flexible Replication pipelines. In this example, we use the existing Triggers database. However, if you are replicating more than one database, you should create a separate CPF database for each master database.

  1. Configure the Master database to use a triggers database.

  2. Select Content Processing on the Master database:

  3. In the Content Processing Summary, click on the Install tab:

  4. On the Content Processing Installation page, click Install:

    Then click OK.

  5. Confirm that Flexible Replication appears in the Pipelines section of the Content Processing Summary page:

  6. On the left-hand navigation menu, navigate to the Content Processing > Domains > Default Master > Pipelines page. Select the Status Change Handling and Flexible Replication pipelines and click OK:

Creating a Replication App Server

In a push replication configuration, the Replica database must be connected to a Replication App Server, an HTTP server used to communicate between the Master database and the Replica database. In a pull replication configuration, the Master database must be connected to a Replication App Server.

The following procedure describes how to create an App Server for a Replica in a push replication configuration.

  1. Under the Replica database, navigate to Flexible Replication. On the Flexible Replication Administration page, click Create under Application Server:

  2. On the Create HTTP Server page, specify a port number of the App Server. Set the other fields as required, but do not change the server name, root directory, or database settings, which have been pre-set by MarkLogic Server. When finished, click OK.

Configuring Push Replication on the Master Database

  1. For the Master database, navigate to Flexible Replication on the Flexible Replication Administration page, and click Default Master under Content Processing:

  2. Click Create to configure replication for the Default Master domain:

  3. Click Create to configure a replication target for the Default Master domain:

  4. In the Database Replication Target page, specify a target name, the target URL that includes the hostname and port number you specified for the Replica's App Server in Creating a Replication App Server.

    In this example, you will be using a secure credential to access the Replica App Server, so the URL must start with https.

  5. In order to communicate securely with the Replica, you should configure a secure credential, as described in Secure Credentials in the Security Guide. Assuming that you have configured a secure credential, select the name of the credential from the credential id menu.

  6. Click OK.

    There are additional security options you may want to enable for your configuration, as described in Replication Security.

Scheduling Replication Push Task

You must create a scheduled task to periodically push updated content on the Master to the Replicas. When a document is updated on the Master, it is immediately replicated to the Replica. A scheduled replication task provides a retry mechanism in the event the initial replication fails. A task is also required to replicate deletes and to replicate all of the documents that were on the master before replication was enabled. For more information on scheduled replication tasks, see Creating a Scheduled Replication Task.

  1. For the Master database, navigate to Flexible Replication and click Create under Scheduled Tasks:

  2. Create a Scheduled Task that defines the frequency in which documents are to be replicated from the Master to the Replica. You must also specify the task user. Do not specify a task host. Click OK.

Loading Documents into the Master Database and Checking Replication

At this point, any documents loaded into the Master database will be replicated to the Replica database.

Be sure to load your data using the same URI as specified in your replicated domain. For example, if you use the default URI (/), make sure all of your document names start with '/'.

Methods for loading content into a database include:

One way to confirm the content has been replicated to the replica is to use the explore feature in Query Console to view the contents of the Replica database. For details on how to use Query Console to explore the contents of a database, see Exploring a Database in the Query Console User Guide.

« Previous chapter
Next chapter »