Previous Next Contents Index


Chapter 14

Managing Distributed Data Synchronization

This chapter describes how to group Netscape Application Servers into data synchronization clusters.

The following subjects are described in this chapter:


About Distributed Data Synchronization
Distributed data synchronization maintains the integrity of shared state and session information across multiple Netscape Application Server (NAS) machines. This is crucial for partitioned and distributed applications that are hosted on multiple NAS machines.

In most enterprises, several NAS machines support one or more distributed applications. For such distributed applications to run successfully, each server must have access to the pertinent information for that application, such as state and session information.

Support for this distribution of information is provided through a system-level distributed data synchronization service that is built into NAS.


How Failover Keeps Data Accessible
The distributed data synchronizer is a system-level service that controls how distributed data, such as application session information, is maintained and made accessible across multiple Netscape Application Server (NAS) machines.

Each NAS machine is made up of the following four "engines:"


What Is a Cluster?
A cluster is a group of Netscape Application Server (NAS) machines that synchronizes data. Servers in a cluster are connected by the same network.

Data that is shared by all the NAS machines in a cluster is stored in Netscape Directory Server. Each NAS machine in your cluster should share one Directory Server; if the NAS machines in your cluster do not share a single Directory Server, cluster settings must be copied from one Directory Server to another so each server has access to identical cluster information. This defeats the purpose of Directory Server, which is designed to simplify information storage by storing the data shared by servers in your enterprise in a central location.

Note. You access cluster information using the Netscape Registry Editor. You cannot edit a NAS machine's cluster settings using the Windows NT regedit tool or any other editor tool. Each folder in the Netscape Registry Editor tree structure, which looks similar to Windows NT's registry tree structure, is referred to as a kregedit key or cluster key in this document.

Setting Up Data Synchronization To set up data synchronization between servers, you must first decide what general role each server performs in the cluster. Then you can edit each cluster entry to set up the server roles and to register the cluster with the synchronizer service. Finally, start each NAS in the order that is determined by server roles.

Synchronization Server Roles
Each server that participates in data synchronization can be set up to fill any one of the roles described in the following table.

Server role

Description
Sync Server

Any NAS machine that can potentially become a Sync Primary. The Sync Server category contains the Sync Primary, Sync Backups and Sync Alternates.

All Sync Servers are listed in the SyncServers key of kregedit.

Sync Primary
The server that is the primary data store, to which all other cluster members communicate for the latest distributed data information.

The first NAS to be started in a cluster must be a Sync Server, and that Sync Server becomes the Sync Primary for the cluster simply because it is started first.

Sync Backup
Any number of Sync Servers, up to a maximum number (MaxBackups) set by you, that mirrors the information on the Sync Primary. Because each Sync Backup increases the load on the cluster, weigh safety against performance impacts when deciding how many backups to assign.

If the Sync Primary becomes inaccessible, the Sync Backup with the highest priority (which is the lowest integer value) relative to other Sync Backups becomes the next Sync Primary.

Sync Alternate
A server listed in the SyncServers kregedit key that is eligible to become a Sync Backup. If the number of Sync Backups falls below the set maximum, the Sync Alternate with the highest priority relative to other Sync Alternates is promoted to Sync Backup.

Each Sync Alternate performs work similar to that of a Sync Local until the Sync Alternate is promoted to Sync Backup.
Sync Local

A server that uses data synchronization services, but is not eligible to become a Sync Primary, Sync Backup, or Sync Alternate. Sync Locals can use, create, and destroy all distributed data, but are never responsible for maintaining that data.

Sync Locals are not listed in the SyncServers kregedit key. However, the SyncServers list in every registry in the cluster contains identification and priority information for each of the Sync Servers in the cluster.

Each Sync Local contacts each of the servers listed in its SyncServers kregedit key until the Sync Local finds the Sync Primary, at which time the Sync Local becomes active in the cluster. If the Sync Local goes through its entire SyncServers kregedit key without finding the Sync Primary, the Sync Local assumes that the cluster is down, and acts as a local server.

Sync Locals communicate only with the Sync Primary, and the other servers in the cluster are not aware of them.

How a Cluster Communicates Servers in a cluster communicate using the GXCONN communication protocol. However, before the servers in a cluster can communicate with each other, each server has to know what cluster it belongs to. NAS becomes an active part of a cluster when you map its synchronizer to the cluster. This procedure is described in Mapping the Synchronizer to the Cluster.

When an application component requests "write" access to a distributed data source, the write occurs first on the Sync Primary. When the data changes on the Sync Primary, the Sync Primary immediately updates the Sync Backups.

Although you can define as many clusters as you like, the synchronizer for each NAS machine can be mapped to only one cluster at a time.

Information Flow Within a Cluster
Sync Backups, Sync Alternates, and Sync Locals communicate with the Sync Primary in a star configuration, as shown in the following illustration:

In this illustration, notice that all servers are communicating with the Sync Primary, although the Sync Backups communicate with it most closely. Also, notice that no Sync Local is assigned a priority number.

Note also that the illustration is an ideal representation of a cluster that has probably just started and has not experienced failover, in that the priority numbers correspond gracefully with the currently assigned roles.


Setting Up and Managing Clusters
Before you set up and begin managing clusters, review the following steps, which provide an overview of the general procedure. More specific procedures for setting up and managing clusters are described in subsequent sections.

  1. Decide which servers will participate in a synchronization group (cluster), and which of those servers will be Sync Servers, eligible to act as the Sync Primary and as Sync Backups, and which will be Sync Locals.
  2. Edit the kregedit keys under Clusters and ClusterName on one of the Sync Servers. Duplicate the ClusterName edits to the registries of all the other servers in the cluster (including the Sync Locals). You need not duplicate edits to the Clusters key since this information is stored in a centrally located Directory Server.
    1. Create the kregedit keys that will contain synchronization information, if necessary.
    2. Edit the SyncServers kregedit key to contain identification information and the priority setting for each Sync Server in the cluster. Often, the larger and more powerful servers are chosen to be the highest-priority Sync Servers.
    3. Set the MaxBackups kregedit key to the number of Sync Backups. Sync Backups are servers that duplicate the data on the Sync Primary.

  3. Enter the name of the cluster in the ClusterName key.
  4. Start the Sync Server that will be the Sync Primary. The server that you want to be the Sync Primary must always be the first server to be started in the cluster, and it becomes the Sync Primary simply because it started first.
  5. After starting the Sync Primary, start the other servers (including the Sync Locals). Although the starting order is not mandated after the Sync Primary starts, it is a good practice to start the Sync Servers in priority order, and then to start the Sync Locals.
    1. Start the servers that will become the Sync Backups, up to the value of MaxBackups. By default, the next servers listed in the SyncServer key that start, up to the value stored under the MaxBackups kregedit key, will become the Sync Backups.
    2. After MaxBackups number of servers have started, remaining Sync Servers that start become Sync Alternates.
    3. All servers not listed in the SyncServers kregedit key become Sync Locals. Sync Locals are part of the cluster simply because each is mapped to the cluster and the SyncServers kregedit key on each contains a list of all the Sync Servers in the cluster.
Determining Sync Server Priority The specific procedure for setting priority is covered in Modifying the Default Cluster for Fast Cluster Set Up and Defining a Cluster. The following section discusses general priority issues and gives a comprehensive example of cluster coordination.

Priority is indicated by an integer value that is set in the SyncServers kregedit key. The lower the value, the higher the priority, so the server assigned a value of 0 has the highest possible priority. The highest acceptable value, and so the lowest priority value, is 65,535.

Priority values are used only to select between Sync Servers in the same status (either between a group of Sync Backups or between a group of Sync Alternates). Only the order in which instances of NAS are started, not priority, determines which server should be the Sync Primary and which Sync Servers will start out as Sync Backups or Sync Alternates.

A Sync Local is not assigned a priority because it is not eligible to become a Sync Server, so a Sync Local cannot become a Sync Primary, Sync Backup, or Sync Alternate.

Which Sync Server becomes the Sync Primary in a cluster is determined simply by which Sync Server is started before any of the other servers. The next Sync Servers that start, up to the value in MaxBackups, become Sync Backups. When the Sync Primary fails, the Sync Backup with the highest priority, which is the lowest integer value, becomes the new Sync Primary.

When a Sync Backup becomes a Sync Primary, the number of Sync Backups falls below the value of MaxBackups. To restore the number of Sync Backups, the Sync Alternate with the highest priority becomes a Sync Backup.

Example: Coordination Within a Seven-Server Cluster
The following example illustrates cluster coordination through server roles, and the part that priority plays in determining those roles. As you trace the role changes through the example, keep in mind that server fallibility has been purposely exaggerated to provide many scenarios.

Although not required, you can ease cluster maintenance by assigning the highest priority to the NAS machine that you will start as the Sync Primary, and the next highest priorities (in descending order) to the Sync Backups. Be aware that the cluster in this example does not do this. Also, notice that this cluster does not follow the recommended practice of starting the servers in priority order.

Assume a seven-server cluster with NAS machines that are numbered 0 to 6. Servers 0 through 4 are Sync Servers that are assigned the same priorities as their server numbers (for example, server 0 has a priority of zero). Servers 5 and 6 are Sync Locals. MaxBackups for the cluster is set to two.

Server 3 fails and goes down. Between the two Sync Backups, server 4 and server 1, server 1 has the higher priority (lower integer value) and it becomes the new Sync Primary. This leaves server 4 as the only Sync Backup.

Because MaxBackups is set to two, one of the Sync Alternates is converted to a Sync Backup. Server 0 becomes the new Sync Backup because it has a higher priority than the other remaining Sync Alternate, server 2. At this point:

Server 3 comes back online. It becomes a Sync Alternate. Even though it was originally a Sync Primary, the synchronizer now sees it as just another Sync Server, so the server does not resume its Sync Primary role. At this point:

Server 0 fails. Server 2 becomes a Sync Backup because it has the higher priority (lower integer value) among the Sync Alternates. At this point:

Server 0 comes back online and becomes a Sync Alternate. Server 1, the Sync Primary, fails. Among the Sync Backups, server 2 has a higher priority than server 4, so server 2 becomes the new Sync Primary. Server 0 becomes a Sync Backup. At this point:

Server 2 fails. Server 0 becomes the Sync Primary and server 3 becomes a Sync Backup. At this point:

Server 3 fails. Even though only one Sync Backup remains, neither server 5 nor server 6 is considered because neither is a Sync Server. At this point:

Modifying the Default Cluster for Fast Cluster Setup The fastest and easiest way to set up a cluster is to set the cluster up when you install NAS.

After installation, the easiest way to set up a cluster is to modify the default cluster that was automatically created when you installed NAS. At installation, the SyncServers kregedit key for the default cluster lists only one server—the server itself. The default cluster is the name of hostname-NoDsync, where hostname is the name of your local machine. For instance, if you install NAS on a machine named "acarey," the default cluster is acarey-NoDysnc. The default cluster contains all that a cluster needs to be complete and active except for the new name for the cluster and the names of all Sync Servers with which to synchronize.

Because the default cluster already contains all the kregedit keys that a cluster needs, you can easily set up a cluster by making a few substitutions in the kregedit keys for the default cluster. If you were creating a completely new cluster, you would have to create the kregedit keys for that new cluster.

Entering IP Addresses Using kregedit
When you edit the SyncServers key for the default cluster, you will enter the IP address for each of the Sync Servers in your cluster.

At installation, the IP address for each NAS machine is placed in the SyncServers key of that server's default cluster. When you enter the address for each Sync Server into the first SyncServer registry key, remember that you can find the information in the registry for each NAS machine.

Note, however, that you will remove this entry on each Sync Local. If you decide later to promote a Sync Local to a Sync Server, you will have to find the address information elsewhere.

Editing Default Cluster Keys
Sync Locals are never listed in the SyncServers key for a legitimate cluster. But, because each Sync Local is automatically listed in its own default cluster, you must remove each Sync Local from its own SyncServers key.

This necessity will be obvious if the cluster settings you edit belong to a Sync Server.

To edit the default cluster keys, perform the following steps:

  1. Stop the application server whose settings you will edit.
  2. Open kregedit by typing kregedit at the command prompt.
  3. Open the following folder:
    1. Double-click the key name to bring up the Modify Value dialog box.
    2. Enter the new name or value in the dialog box.
    3. Click OK.
Note.

  1. Check and modify the SyncTimerInterval value, as necessary, which is found in the following location:
  2. Change the default name (in this case, acarey-NoDsync) to a new, unique name for your cluster.
  3. Check and modify the MaxBackups value, as necessary.
Note.

  1. Add each Sync Server to the cluster under SyncServers.
    1. Add the IP address and port number for the Sync Server.
    2. Set the priority for each Sync Server by double-clicking the priority value to bring up a pop-up window, entering the priority number, and clicking OK. The IP address, port number, and priority for the Sync Server should have been listed under the SyncServers key at installation.

  2. Close kregedit when you're finished.
  3. Restart all application servers effected by these modifications.
All changes you make to the SyncServers key now apply to each server in the cluster.

After correctly completing these steps, you have redefined the default cluster. Now, follow the procedure in Mapping the Synchronizer to the Cluster to enable communication between the servers in the cluster.

Mapping the Synchronizer to the Cluster For a cluster to communicate, the synchronizer in each server must know to which cluster the synchronizer belongs. This is done by mapping the ClusterName key of each synchronizer to the name of an actual cluster.

To map the synchronizer to a cluster, perform the following steps:

  1. Stop the application server whose registry you will edit.
  2. Open kregedit by typing kregedit at the command prompt.
  3. Open the following key:
  4. Rename the key under ClusterName to the name of the cluster to which the synchronizer should connect.
  5. Close kregedit when you are finished. The synchronizer should now be mapped to the cluster
Defining a Cluster Create a cluster to organize NAS machines into data-synchronizing network-centric groups.

Even though each NAS machine can be mapped to only one cluster at a time, you can define as many clusters as you like. Some installations might define multiple clusters for testing purposes, for example.

While you can edit the default cluster to easily set up your first cluster definition, editing the default cluster defines only one cluster. To get more than one definition, create the additional clusters.

To create a cluster, perform the following steps:

  1. Stop the application server whose registry you will edit.
  2. Open kregedit by typing kregedit at the command prompt.
  3. Open the following key:
Note.

  1. Add the SyncTimerInterval value, as necessary, which can be found in the following location:
  2. Add a new, unique name for your cluster.
  3. Add the MaxBackups value, as necessary.
Note.

  1. Add the SyncServers key under the name of the cluster.
  2. Add each Sync Server to the cluster under SyncServers.
    1. Add the IP address and port number for the Sync Server.
    2. Set the priority for each Sync Server.

  3. Close kregedit when you're finished.
After correctly completing these steps, you have defined a cluster. You can define as many clusters as you like, but you can map the synchronizer to only one cluster at a time. See Mapping the Synchronizer to the Cluster for the procedure that enables communication.


Using the Administrator to Configure Clusters
You can perform the following tasks to configure clusters using Netscape Application Server (NAS) Administrator:

Note that to properly configure a cluster using NAS Administrator, you must register all the servers in the cluster. Otherwise, configuration changes will not apply across all the servers in the cluster.

For information about editing cluster settings directly, see the various sections earlier in this chapter that discuss how to configure clusters.

Creating a Cluster To create a new cluster, perform the following steps:

  1. From the NAS Administrator toolbar, click the General button to open the General window.
  2. In the right pane of the General window, click the Cluster tab.
  3. Double-click inside the Cluster Name drop-down box to select hostname-No-Dsync.
  4. Use the Delete key on your keyboard to clear the Cluster Name drop-down box.
  5. Type the name of your new cluster in the Cluster Name drop-down box and press the Enter key on your keyboard.
  6. Click Apply Changes.
After you restart the server, you can add NAS machines to the new cluster as described in the following section.

Adding a Server to a Cluster To add an unassigned server to a cluster, or to reassign a server to a different cluster, perform the following steps:

  1. From the NAS Administrator toolbar, click the General button to open the General window.
  2. Click the Cluster tab.
  3. In the left pane of the General window, click the name of the server you want to add to a cluster.
  4. From the Cluster Name drop-down box, select the name of the cluster you want to add the server to.
  5. Click Apply Changes.
  6. Shut down and restart every server in the cluster, including the server you just added. For changes to apply across the cluster, you must restart every machine to reload the memory on each machine with the cluster configuration changes. If at least one machine has a different cluster configuration loaded into memory than the other machines in the cluster, the new settings will not take effect and data synchronization will not work properly.
  7. If when adding the server to a cluster, you removed it from another, you must also shut down and restart every server in the cluster from which it was removed.
Removing a Server from a Cluster To remove a server from a cluster, perform the following steps:

  1. From the NAS Administrator toolbar, click the General button to open the General window.
  2. Click the Clusters tab to display the following window:
  3. In the left pane of the General window, click the name of the server you want to remove from the cluster.
  4. Click Remove from Cluster.
  5. Click Apply Changes.
  6. Shut down and restart every server in the cluster, including the server you just removed. For changes to apply across the cluster, you must restart every machine to reload the memory on each machine with the cluster configuration changes. If at least one machine has a different cluster configuration loaded into memory than the other machines in the cluster, the new settings will not take effect and data synchronization will not work properly.
Changing Sync Server Priority To assign a new Sync Server priority to a server that is in a cluster, perform the following steps:

  1. From the NAS Administrator toolbar, click the General button to open the General window.
  2. Click the Clusters tab to display the following window:
  3. In the left pane of the General window, click a server that is a member of the cluster whose Sync Server priority you want to change.
  4. In the Priority List text box, click the name of the server whose Sync Server priority you want to change.
  5. Click one of the following:
  6. When you finish reassigning priorities, click Apply Changes.
  7. Restart every server in the cluster, including the one whose priority you just changed. For changes in Sync Server priority to apply across a cluster, you must restart every machine so that they are all aware of their new priority sequence, relative to one another.
Modifying the Maximum Number of Sync Backups To change the maximum number of Sync Backups allowed during a cluster session, perform the following steps:

  1. From the NAS Administrator toolbar, click the General button to open the General window.
  2. Click the Clusters tab to display the following window:
  3. In the left pane of the General window, click the name of a server that is a member of the cluster you want to modify.
  4. Enter the maximum number of Sync Backups allowed during a single cluster session in Maximum Number of Sync Backups.
Restart every server in the cluster. For changes to apply across a cluster, you must restart every machine so that they are all aware of the change in the maximum number of Sync Backups allowed.

 

© Copyright 1999 Netscape Communications Corp.