Forcing Replication Updates from the Command-Line
287
2. Right click the replication agreement, and choose
Send Updates Now
from the drop-down list.
This initiates replication toward the server that holds the information that needs to be updated.
8.11.2. Forcing Replication Updates from the Command-Line
From the consumer that requires updating, run a script that prompts the supplier to send replication
updates immediately. This script is shown in
Example 8.5, “Replicate_Now Script Example”
.
Copy this example script and name it something like
replicate_now.sh
. Substitute the actual
values for the variables listed in
Example 8.5, “Replicate_Now Script Example”
.
NOTE
This script must be run manually since it cannot be configured to run automatically as
soon as the server, which was offline, comes back online again.
#!/bin/sh
SUP_HOST=
supplier_hostname
SUP_PORT=
supplier_portnumber
SUP_MGRDN=
supplier_directoryManager
SUP_MGRPW=
supplier_directoryManager_password
MY_HOST=
consumer_hostname
MY_PORT=
consumer_portnumber
ldapsearch -1 -T -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.$$
Example 8.5. Replicate_Now Script Example
Variable
Definition
supplier_hostname
Hostname of the supplier to contact for
information on replication agreements with the
current consumer.
supplier_portnumber
LDAP port in use on the supplier.
supplier_directoryManager
DN of the privileged Directory Manager user on
the supplier.
supplier_directoryManager_password
Password of the privileged Directory Manager
user on the supplier.
Содержание DIRECTORY SERVER 8.0
Страница 18: ...xviii ...
Страница 29: ...Configuring the Directory Manager 11 6 Enter the new password and confirm it 7 Click Save ...
Страница 30: ...12 ...
Страница 112: ...94 ...
Страница 128: ...110 ...
Страница 190: ...Chapter 6 Managing Access Control 172 4 Click New to open the Access Control Editor ...
Страница 224: ...206 ...
Страница 324: ...306 ...
Страница 334: ...316 ...
Страница 358: ...340 ...
Страница 410: ...392 ...
Страница 420: ...402 ...
Страница 444: ...426 ...
Страница 454: ...436 ...
Страница 464: ...446 ...
Страница 484: ...466 ...
Страница 512: ...494 ...
Страница 522: ...504 ...