Template Example

This example illustrates a scenario in which one template is created and realized on two servers, then realized on a third server.

About this task

The template Replicateset1 is defined on three tables in the college database: staff, students, and schedule. The template is first realized on the servers g_cdr_ol_1 and g_cdr_ol_2.

This procedure is performed as follows:

Procedure

  1. Define the template Replicateset1 on the staff, students, and schedule tables of the college database:
    cdr define template -c g_cdr_ol_1 Replicateset1 -M g_cdr_ol_1\ 
     -C "timestamp" -A -R -d college testadm.staff testadm.students\
     testadm.schedule

    This command also creates the replicate set Replicateset1.

  2. Realize the template on the server g_cdr_ol_1:
    cdr realize template -c g_cdr_ol_1 Replicateset1 "college@g_cdr_ol_1"
  3. Realize the template on server g_cdr_ol_2 and synchronize the data with server g_cdr_ol_1:
    cdr realize template -c g_cdr_ol_2 -u -S g_cdr_ol_1 \
    Replicateset1 "college@g_cdr_ol_2"
  4. Realize the Replicateset1 template on a new server g_cdr_ol_3 and synchronize the data with server g_cdr_ol_1. The g_cdr_ol_3 server participant is automatically added to all replicates within the Replicateset1 template:
    cdr realize template -c g_cdr_ol_1 -u -S g_cdr_ol_1\ 
      Replicateset1 "g_cdr_ol_3"