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 replcheck.pl tool determines whether two or more replicated Sun™ ONE Directory Servers are synchronized. This chapter provides instructions on how to use replcheck.pl. It contains the following sections:


Overview

The replcheck.pl 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.


Note

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



Tool Dependencies

The replcheck.pl 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."


Caution

By default, the first line of the replcheck.pl script contains:

#!/usr/iplanet/servers/bin/slapd/admin/bin/perl

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:

#!/opt/iPlanet/unsupported/perLdap



Command Usage

The syntax of replcheck.pl on the command-line takes the following form:

replcheck.pl [-w DirectoryManagerPassword] -b baseDN host1:port1 host2:port2 ...

Where:

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


Return Values

The replcheck.pl 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 replcheck.pl -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 replcheck.pl

Connected to master

Connected to ro-hub

-------------------------

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

=> {replica 1 ldap://master.example.com:1389} 3c63e0b0000000010000

3c63f44b000100010000

=> {replica 3 ldap://ro-hub.example.com:1389}

=> {replicageneration} 3c63da79000000030000

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

=> {replica 1 ldap://master.example.com:1389} 3c63e0b0000000010000

3c63f443000100010000

=> {replica 3 ldap://ro-hub.example.com:1389}

=> {replicageneration} 3c63da79000000030000

****

<{replica 1 ldap://master.example.com:1389} 3c63e0b0000000010000

3c63f44b000100010000>

----

<{replica 1 ldap://master.example.com:1389} 3c63e0b0000000010000

3c63f443000100010000>

****************

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

Servers are not in sync

$ echo $?    ## show return value

1

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 replcheck.pl tool reported that the second host on the command-line, ro-hub, is out-of-date.


Note

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.