Replication

Back | Home | Next
Table of Contents
Metacat Replication
Overview
Databased Information
Example
What happens with gamma?
What happens with alpha?
What happens with lamda?
The Replication Control Panel
Certificates
Generate Certificates on both the replication client and server.
Generate Certificate for Tomcat standalone (no Apache)
Generate Certificate for Apache/Tomcat
Register the partner machines certificate
Metacat Replication
Overview

Metacat has built-in replication to allow different Metacat servers to share data between themselves. Metacat not only replicates XML documents but also data files.

Metacat's hub feature allows it to replicate not only it's own server's original documents, but also those that were replicated from other servers. This functionality allows for a more complex chaining replication structure.

The replication scheme that Metacat uses is both push and pull. There are several triggers that can start a replication mechanism:

Databased Information

Each server contains a list of servers to which it can replicate. One-way replication is enabled by the 'replicate' and 'datareplicate' flags in the list. The server list may look like the following.

serverid server last_checked replicate datareplicate hub
1 localhost null 0 0 0
2 alpha.nceas.ucsb.edu:8080/berkley/servlet/replication 2001-01-22 14:52:12.1 0 0 0
3 dev.nceas.ucsb.edu/Metacat/servlet/replication 2001-01-23 9:10:02.5 1 1 0

The server list is kept in a table in the database called xml_replication. Localhost must always be the first entry in the table and have a serverid of 1. The database fields are:
Example
Here we show an example setup of three replication servers. We will discuss each.

First, note that in order for replication to occur, both partner servers must have each other in their respective tables or replication will not take place. Also, certificates must be set up correctly on both servers in order for replication to work. See the certificates section below.

host replication table
gamma.nceas.ucsb.edu
server last_checked replicate datareplicate hub
localhost null 0 0 0
alpha.nceas.ucsb.edu:8080/berkley/servlet/replication    2001-01-22 14:52:12.1 0 0 0
lamda.nceas.ucsb.edu/Metacat/servlet/replication 2001-01-23 9:10:02.5 1 1 0
alpha.nceas.ucsb.edu
server last_checked replicate datareplicate hub
localhost null 0 0 0
gamma.nceas.ucsb.edu:8080/berkley/servlet/replication 2001-01-21 11:33:12.7 0 1 0
lamda.nceas.ucsb.edu/Metacat/servlet/replication 2001-01-23 10:22:02.5 1 0 0
lamda.nceas.ucsb.edu
server last_checked replicate datareplicate hub
localhost null 0 0 0
gamma.nceas.ucsb.edu:8080/berkley/servlet/replication 2001-01-21 11:33:12.7 0 0 0
alpha.nceas.ucsb.edu:8080/Metacat/servlet/replication 2001-01-22 12:15:32.5 1 1 1
What happens with gamma?
What happens with alpha?
What happens with lamda?
The Replication Control Panel:
There is an html control panel for controling replication. After installing Metacat, you can access it by calling replControl.html. For instance, if you setup a Metacat application context called 'knb' you would probably type :
http://server.domain.com/knb/style/skins/dev/replControl.html
The control panel is an easy interface for adding/removing/altering servers and starting the delta-T handler. It will also allow you to 'force replicate' your server list. This is useful if you want to initialize the state of one Metacat server from an existing state of another (i.e. copy all of the data from an existing server).

Certificates:
You will need to generate security certificates on both the replication client and server. The certificates will be exchanged so that each machine understands that the other has access for replication.

The following are the steps to generate and exchange certificates on systems running Tomcat 5 and java 1.5. Note that if Tomcat is running in conjunction with Apache, the process is somewhat different than if it is running standalone.
Generate Certificates on both the replication client and server.
Generate Certificate for Tomcat standalone (no Apache)
Generate Certificate for Apache/Tomcat
Register the partner machines certificate.
At this point, you have created a certificate for each replication server and scp-ed them across to each other. Now you need to import the remote server's certificate on the local machine. Perform the following steps for each replication server. Back | Home | Next