Hierarchy Example

This example adds a replication tree to the fully-connected environment of the usa, italy, and japan replication servers.

The nonroot servers boston and denver are children of usa. (The leaf server miami is a child of boston.) Hierarchical Tree Example shows the replication hierarchy.
Figure 1: Hierarchical Tree Example

begin figure description - This figure is described in the surrounding text - end figure description

To try this example, you need to prepare three additional database servers: boston, denver, and miami. To prepare the database servers, use the techniques described in Replication Example Environment.

The following example defines a replication hierarchy that includes denver, boston, and miami and, whose root is usa.

To define a hierarchy

  1. Add boston to the replication hierarchy as a nonroot server attached to the root server usa:
    cdr define server --connect=boston --nonroot --init \
    --sync g_usa g_boston

    The backslash (\) indicates that the command continues on the next line.

  2. Add denver to the replication hierarchy as a nonroot server attached to the root server usa:
    cdr define server -c denver -I -N --ats=/ix/myats \
    -S g_usa g_denver

    This command uses short forms for the connect, init, and sync options. (For information about the short forms, refer to Option Abbreviations.) The command also specifies a directory for collecting information about failed replication transactions, /ix/myats.

  3. List the replication servers as seen by the usa replication server:
    cdr list server

    The root server usa is fully connected to all the other root servers. Therefore usa knows the connection status of all other root servers and of its two child servers, denver and boston. The command returns the following information:

    SERVER    ID   STATE   STATUS   QUEUE   CONNECTION CHANGED
    -----------------------------------------------------------
    g_boston   3   Active  Connected    0   Aug 19 14:20:03 2000
    g_denver  27   Active  Connected    0   Aug 19 14:20:03 2000
    g_italy    8   Active  Connected    0   Aug 19 14:20:03 2000
    g_japan    6   Active  Connected    0   Aug 19 14:20:03 2000
    g_usa      1   Active  Local        0     
  4. List the replication servers as seen by the denver replication server:
    cdr list server --connect=denver

    The nonroot server denver has a complete global catalog of replication information, so it knows all the other servers in its replication system. However, denver knows the connection status only of itself and its parent, usa.

    The command returns the following information:

    SERVER    ID   STATE   STATUS   QUEUE   CONNECTION CHANGED
    -----------------------------------------------------------
    g_boston   3   Active               0   
    g_denver  27   Active  Local        0
    g_italy    8   Active               0
    g_japan    6   Active               0
    g_usa      1   Active  Connected    0   Aug 19 14:20:03 2000   
  5. Define miami as a leaf server whose parent is boston:
    cdr define server -c miami -I --leaf -S g_boston g_miami
  6. List the replication servers as seen by miami:
    cdr list server -c miami

    As a leaf replication server, miami has a limited catalog of replication information. It knows only about itself and its parent.

    The command returns the following information:

    SERVER    ID   STATE   STATUS   QUEUE   CONNECTION CHANGED
    -----------------------------------------------------------
    g_boston   3   Active  Connected    0   Aug19 14:35:17 2000
    g_miami    4   Active  Local        0   
  7. List details about the usa replication server:
    cdr list server g_usa

    The server is a hub; that is, it forwards replication information to and from other servers. It uses the default values for idle timeout, send queue, receive queue, and ATS directory.

    The command returns the following information:

    NAME       ID   ATTRIBUTES
    --------------------------------------------------------------
    g_usa      1    timeout=15 hub sendq=rootdbs recvq=rootdbs atsdir=/tmp