Sun ONE Directory Server Resource Kit 5.2 Tools Reference |
Chapter 25
The Replication Checker ToolThe 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:
OverviewThe 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 DependenciesThe 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."
Command UsageThe syntax of replcheck.pl on the command-line takes the following form:
replcheck.pl [-w DirectoryManagerPassword] -b baseDN host1:port1 host2:port2 ...
Where:
- DirectoryManagerPassword is the password for the "cn=Directory Manager" common to all replicas. If this password is not identical on all replicas, omit this option to be prompted interactively for each password.
- baseDN is root of the subtree for which you wish to know the replication status.
- hostn:portn is the hostname and port number for each of the replicated Directory Servers. If :port is omitted, port 389 is used by default. You must specify at least two hostn:portn pairs, and you may specify more replicas as you wish.
The replcheck.pl -H command will display the usage help text that gives the command syntax.
Return ValuesThe 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 ExampleThe 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:1389In 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.
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.