Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun ONE Directory Server Resource Kit 5.2 Tools Reference 

Chapter 25
The Replication Checker Tool

The tool determines whether two or more replicated Sun™ ONE Directory Servers are synchronized. This chapter provides instructions on how to use It contains the following sections:


The tool is a Perl script used to analyze replicated directory servers. It determines whether two or more replicated Directory Servers are synchronized; it also reports which of the replicas is not up-to-date. The script accesses internal attributes to report on the status of the replicated sub-tree. The DSRK includes the tool in the DSRK_base/perl directory.


The tool can only determine replication status for versions 5.x of the Sun ONE Directory Server.

Tool Dependencies

The tool is dependent upon the PerLDAP libraries provided with Directory Server 5.x. PerLDAP is a third-party tool that has libraries of Perl routines for accessing a directory server and performing LDAP operations. In order to use the PerLDAP libraries you must build and install this tool. Instructions on this are described in Chapter 31, "Unsupported Utilities."


By default, the first line of the script contains:


You should modify this first line if you did not install Directory Server in the default location on your machine. Alternately, if you do not have Directory Server installed on your machine, modify this line to use the libraries installed in the unsupported directory of the Directory Server Resource Kit:


Command Usage

The syntax of on the command-line takes the following form: [-w DirectoryManagerPassword] -b baseDN host1:port1 host2:port2 ...


The -H command will display the usage help text that gives the command syntax.

Return Values

The script returns 0 if all replicas are synchronized, and a positive integer otherwise. This allows the script to be used in other administrative scripts if, for example, there is a need to perform automated diagnostics.

If a replica is not in sync, the script will return its 0-based index (n-1) in the list of hosts on the command-line. For example, if the replica on host2 is not up to date, the script will return 1.

Command-Line Example

The sample reproduced in Code Example 25-1 shows the output for a comparison of an internal attribute, the replication update vector, that stores the replication status. The syntax used for this is:

$ perl -I installDir -w password -b "dc=example,dc=com" \
                               master:1389 ro-hub:1389

In this scenario, the command checks the replication status for the entire replicated tree under the "dc=example,dc=com" suffix, between a supplier replica hosted by master and a read-only consumer hosted by ro-hub.

Code Example 25-1  Sample Output for

Connected to master

Connected to ro-hub


Getting replication update vector for master replica of dc=example,dc=com

=> {replica 1 ldap://} 3c63e0b0000000010000


=> {replica 3 ldap://}

=> {replicageneration} 3c63da79000000030000

Getting replication update vector for ro-hub replica of dc=example,dc=com

=> {replica 1 ldap://} 3c63e0b0000000010000


=> {replica 3 ldap://}

=> {replicageneration} 3c63da79000000030000


<{replica 1 ldap://} 3c63e0b0000000010000



<{replica 1 ldap://} 3c63e0b0000000010000



Replication Update Vector for ro-hub doesn’t match with master

Servers are not in sync

$ echo $?    ## show return value


The first part of the output (up to the **** separator) displays the replication update vector in each replica. The second part compares all vector elements for each pair of replicas being considered and displays those that do not match. These elements encode information about the latest replication operations, and any differences in this pair of values indicates that the replicas are not up-to-date.

In this example the two elements differ slightly, and the tool displays the unmatched vector elements and human-readable explanation. Finally, the return value shows that the tool reported that the second host on the command-line, ro-hub, is out-of-date.


The -I installDir option in the example is a standard Perl option and is discussed in the Perl man page.

Previous      Contents      Index      Next     

Copyright 2004 Sun Microsystems, Inc. All rights reserved.