15.8. About Initializing a Consumer
After creating the replication agreement, initialize the consumer. During this operation, the supplier copies the existing data to the consumer.
Important
Replication will not begin until you initialized the consumer.
15.8.1. When to Initialize a Consumer
Consumer initialization involves copying data from the supplier server to the consumer server. Once the subtree has been physically placed on the consumer, the supplier server can begin replaying update operations to the consumer server.
Under normal operations, the consumer should not ever have to be reinitialized. However, any time there is a chance that there is a big discrepancy between the supplier's data and the consumer's, reinitialize the consumer. For example, if the data on the supplier server is restored from backup, then all consumers supplied by that server should be reinitialized. As another example, if the supplier has not been able to contact the consumer for a long time, like a week, the supplier may determine that the consumer is too far out of date to be updated, and must be reinitialized.
The consumer can either be initialized online using the web console or manually using the command line. Online consumer initialization using the web console is an effective method of initializing a small number of consumers. However, since each replica is initialized in sequence, this method is not suited to initializing a large number of replicas. Online consumer initialization is the method to use when the consumer is initialized as part of configuring the replication agreement on the supplier server.
Manual consumer initialization using the command line is a more effective method of initializing a large number of consumers from a single LDIF file.
15.8.2. Setting Initialization Timeouts
If initialization of large databases fails due to timeouts, set one of the following to a large enough time period or to an unlimited period to enable Directory Server to initialize the entire database before the operation times out:
- The
nsslapd-idletimeout
configuration parameter in thecn=config
entry sets the timeout for all replication agreements on the server. For example, to disable the timeout globally:# dsconf -D "cn=Directory Manager" ldap://server.example.com config replace nsslapd-idletimeout=0
- The
nsIdleTimeout
parameter in the replication manager's DN set's the timeout for all agreements that use this replication manager entry. For example, to disable the timeout for thecn=replication manager,cn=config
entry:# ldapmodify -D "cn=Directory Manager" -w -h server.example.com -p 389 -x dn: cn=replication manager,cn=config changetype: modify add: nsIdleTimeout nsIdleTimeout: 0
15.8.3. Initializing a Consumer
This section describes initializing a consumer using the command line and in the web console.
15.8.3.1. Initializing a Consumer Using the Command Line
You can initialize a consumer online and offline using the command line. This section explains both procedures.
15.8.3.1.1. Initializing a Consumer Online
After creating the replication agreement, use the
dsconf repl-agmt init
command to initialize a consumer online:
# dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt \ init --suffix="suffix" agreement_name
15.8.3.1.2. Initializing a Consumer Offline
To initialize a consumer offline:
- On the supplier:
- Shutdown the instance on the supplier:
# dsctl instance_name stop
- Export the
userRoot
database that contains the suffix to replicate into the/tmp/example.ldif
file with replication information:# dsctl instance_name db2ldif --replication userRoot /tmp/example.ldif
- Start the instance on the supplier:
# dsctl instance_name start
- Copy the exported file to the consumer.
- Import the data on the consumer. For details, see Section 6.1.2.2, “Importing Data While the Server is Offline”.
15.8.4. Initializing a Consumer Using the Web Console
To initialize a consumer online using the web console:
- Open the Directory Server user interface in the web console. See Section 1.4, “Logging Into Directory Server Using the Web Console”.
- Select the instance.
- Open themenu, and select the suffix.
- On the Choose Action menu next to the replication agreement for the suffix and select Initialize Agreement.tab, open theIf the initialization completed successfully, web console displays the
Error (0) Replica acquired successfully: Incremental update succeeded
message in the Last Update Status column.Depending on the amount of data to replicate, the initialization can be time-consuming.