Sun Iplanet Directory Server 5.1 Replication

From: Everett, Craig (caeverett@firstam.com)
Date: Tue Jun 21 2005 - 13:59:36 EDT


Hi Managers.

I'm setting up replication for my LDAP environment to provide for site
failover with disaster recovery. I'm running Sun Iplanet Directory
Server 5.1 SP3 on Solaris 9. I found a script for replication in the 5.1
admin guide. The script uses ldapsearch and ldapmodify to perform the
replication from supplier to consumer. Below is the script. From what I
can tell this script creates an ldif file and then conducts a modify via
the network.

The two questions I have are how is the data copied (tcp/ip on the port
that LDAP is set to run on?) and does anyone have a detailed man pages
for ldapsearch and ldapmodify. The man pages that are in iplanet
documentation and solaris don't show half of these options below. I need
to understand exactly what these commands are doing.

Thanks for your help,
Craig Everett

This script is found at
http://docs.sun.com/source/816-5606-10/replicat_new.htm#1107360

#!/bin/sh
SUP_HOST=supplier_hostname
SUP_PORT=supplier_portnumber
SUP_MGRDN=supplier_directoryManager
SUP_MGRPW=supplier_directoryManager_passwd
MY_HOST=consumer_hostname
MY_PORT=consumer_portnumber

ldapsearch -1 -h ${SUP_HOST} -p ${SUP_PORT} -D "${SUP_MGRDN}" \
-w ${SUP_MGRPW} -b "cn=mapping tree, cn=config" \
"(&(objectclass=nsds5replicationagreement) \
(nsDS5ReplicaHost=${MY_HOST})(nsDS5ReplicaPort=${MY_PORT}))" \
dn nsds5ReplicaUpdateSchedule > /tmp/$$

cat /tmp/$$ |
awk '
BEGIN { s = 0 }
/^dn: / { print $0;
print "changetype: modify";
print "replace: nsds5ReplicaUpdateSchedule";
print "nsds5ReplicaUpdateSchedule: 0000-2359 0123456";
print "-";
print "";
print $0;
print "changetype: modify";
print "replace: nsds5ReplicaUpdateSchedule";
}

/^nsds5ReplicaUpdateSchedule: / { s = 1; print $0; }

/^$/ {
if ( $s == 1 )
{ print "-" ; print ""; }
else
{ print "nsds5ReplicaUpdateSchedule: 0000-2359 0123456";
print "-" ; print ""; };
s = 0; }

' > /tmp/ldif.$$

echo "Ldif is in /tmp/ldif.$$"
echo

ldapmodify -c -h ${SUP_HOST} -p ${SUP_PORT} -D "${SUP_MGRDN}" \
-w ${SUP_MGRPW} -f /tmp/ldif.$$
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:56 EDT