15.18. Initializing Consumers
nsslapd-idletimeoutsetting must be set to a large enough time period (or even an unlimited period) to allow the entire database to be initialized before the operation times out. Alternatively, the
nsIdleTimeoutsetting for the supplier bind DN entry can be set high enough to allow the online initialization operation to complete, without having to change the global setting.
15.18.1. When to Initialize a Consumer
15.18.2. Online Consumer Initialization Using the Console
- Create a replication agreement.
- On the supplier server, on the Directory Server Console, select the Configuration tab.
- Expand the Replication folder, then expand the replicated database. Right-click the replication agreement, and choose Initialize Consumer from the pop-up menu.A message opens warning that any information already stored in the replica on the consumer will be removed.
- Click Yes in the confirmation box.
15.18.3. Initializing Consumers Online Using the Command Line
nsds5BeginReplicaRefreshattribute to the replication agreement entry. This attribute is absent by default, and it will be automatically deleted once the consumer initialization is complete.
- Find the DN of the replication agreement on the supplier server that is for the consumer to be initialized. For example:
# ldapsearch -h supplier1.example.com -p 389 -D "cn=Directory Manager" -W -s sub -b cn=config "(objectclass=nsds5ReplicationAgreement)"This command returns all of the replication agreements configured on the supplier in LDIF format. Get the DN of the replication agreement with the consumer to be initialized. This is the replication agreement which will be edited.
- Edit the replication agreement, and add the
# ldapmodify -D "cn=Directory Manager" -W -x -h supplier1.example.com dn: cn=ExampleAgreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config changetype: modify replace: nsds5BeginReplicaRefresh nsds5BeginReplicaRefresh: start
ldapmodifydoes not prompt for input; simply type in the LDIF statement, and then hit enter twice when the LDIF statement is complete. Close the
ldapmodifyutility by hitting Ctrl+C.
ldapsearchfor the replication agreement entry.
# ldapsearch -D "cn=Directory Manager" -W -p 389 -h server.example.com -x -s base -b 'cn=ExampleAgreement,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config' '(objectclass=*)'
nsds5BeginReplicaRefreshattribute is present, the initialization is still in progress. If the initialization is complete, then the attribute
nsds5ReplicaLastInitStatusshows the status. If the initialization was successful, the value of
Total update succeeded. If the initialization was not successful, this attribute shows information about the error; check the error logs for both the supplier and consumer for additional information.
15.18.4. Manual Consumer Initialization Using the Command Line
- Create a replication agreement.
- Export the replica on the supplier server to an LDIF file.
- Import the LDIF file with the supplier replica contents to the consumer server.
22.214.171.124. Exporting a Replica to LDIF
- When creating a replication agreement, by selecting Create consumer initialization file in the Initialize Consumer dialog box of the Replication Agreement Wizard.
- From the Directory Server Console, by right-clicking the replication agreement under the Replication folder and choosing Create LDIF File from the pop-up menu.
- From the command line by using the export command, as described in Section 6.2.3, “Exporting a Database to LDIF Using the Command Line”. Exporting to LDIF with any of the command-line tools requires using an option to export the database as a replica; this means that the exported LDIF contains the proper entries to initialize the consumer when the LDIF is imported.For the
db2ldif.plscripts, this is the
-roption. For example:
-r-n database1 -a /export/output.ldifFor the
cn=export,cn=tasks,cn=configentry, this is the
-a-D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=example export,cn=export,cn=tasks,cn=config changetype: add objectclass: extensibleObject cn: example export nsInstance: userRoot nsFilename: /home/files/example.ldif
126.96.36.199. Importing the LDIF File to the Consumer Server
ldif2db.plscript. Both import methods are described in Section 6.1.4, “Importing from the Command Line”.