There are two ways that you can initialize a consumer:
This section first describes consumer initialization in detail and then provides instructions on both consumer creation methods.
When to Initialize a Consumer
After you have created a replication agreement, you must initialize the consumer. That is, you must physically copy directory data from the supplier server to the consumer server so that future changes can be replayed to consumer servers.
Consumer initialization involves copying the replicated directory entries from the supplier server to the consumer server. When these entries are placed on the consumer server, the appropriate copiedFrom attribute must also be placed on the replicated tree (see "Replication Algorithms" for details).
Once the tree has been physically placed on the consumer, the supplier server can begin replaying update operations to the consumer server (SIR) or the consumer can begin requesting data from the supplier (CIR).
In addition, any attempts to modify data on the consumer that is owned by the supplier are referred to the supplier server. For more information about referrals, see Chapter 14, "Managing Referrals."
Under normal operations, the consumer should not ever have to be initialized again. However, there are several major events that can require a reinitialization of the consumer server:
This message also indicates whether the inconsistency could be repaired.
The process that you use to initialize or reinitialize a consumer differs depending on the type of consumer creation you use. See "Online Consumer Creation" (next) or "Manual Consumer Creation" for more information.
Note. When a consumer server is being initialized via online consumer initialization,
all operations (including searches) on the supplied tree are referred to the
supplier server until the initialization process is completed.
Online Consumer Creation
Online consumer creation is the easiest way to initialize or reinitialize a consumer. However, this process can be very time consuming, and for large databases you may find that manual consumer creation is a more appropriate approach (refer to "Manual Consumer Creation" for more information).
Online consumer creation works by moving data from the supplier to the consumer server over LDAP. That is, the replicated information is placed on the consumer server using LDAP add operations.
Before using online consumer creation, consider the performance implications of this method of consumer initialization. On a reasonably fast single processor (such as an Intel Pentium II or a Sun Sparc Ultra 1), you can expect online consumer creation to proceed at the following rates:
- For fresh initializations (that is, if the consumer server's tree is empty), the supplier can add 9,000 to 36,000 entries per hour. The actual rate will depend on characteristics of your server such as the size of your entries, the amount of indexing your consumer is performing, the speed of your disk, the amount of RAM available to the consumer server, and the speed of your networks.
- For reinitializations, the supplier can add from 4,500 to 18,000 entries per hour. The performance drops by half because the online consumer creation process deletes all previously replicated entries from the consumer server before the consumer is initialized with a fresh set of data.
When You Should Use Online Consumer Creation
Essentially, you should always use online consumer creation unless you find the time that it takes to complete this operation objectionable.
You should always use online consumer creation when the consumer server has multiple subtrees supplied by different supplier servers, as shown in the figure below. In this case, you cannot use manual consumer initialization to initialize the consumer because the import process used in manual consumer initialization replaces the entire database, including the subtrees supplied by other servers.
In the following figure, both Engineering and HR are supplier servers that replicate data to the main corporate directory.
How to Use Online Consumer Creation
To use online consumer creation:
Create a replication agreement. For details on creating replication agreements, see "Creating an SIR Agreement" or "Creating a CIR Agreement".
On the supplier server's Directory Server Console, right-click the appropriate replication agreement on the Configuration tab and select Initialize Consumer from the pop-up menu.
Click Yes in the confirmation box.
Online consumer creation begins immediately. You can check the status of the online consumer creation on the console's Status tab. For more information about monitoring replication and initialization status, see "Monitoring Replication Status". If online consumer creation is in progress, the status shows that a replica is being initialized. To update this window, click Refresh. When online consumer creation finishes, the status changes to reflect this.
You can configure your server to automatically reinitialize a consumer when the server detects an unexplainable inconsistency. To do this, place the following line in the slapd.conf file of either the supplier server (for supplier-initiated replication) or the consumer server (for consumer-initiated replication):
orcauto on
See "Directory Server Configuration Files" for information on where the server stores slapd.conf.
The "Enable Online Consumer Creation" slapd.conf parameter causes the consumer to be reinitialized if a version number mismatch occurs between the supplier server's database and the replicated entries, or if the supplier is unable to replay changes to the consumer due to problems with the change log (see "When to Initialize a Consumer" for more information).
Manual Consumer Creation
Manual consumer creation is the fastest method of consumer initialization for sites that are replicating very large numbers of entries. However, the manual process is more complicated than the online creation process.
You should use the manual process whenever you find that the online process is inappropriate due to performance concerns. However, you should never use the manual process if your consumer server contains directory data that is mastered by more than one directory server. That is, use the manual process only if your entire consumer server's database is supplied by a single supplier server. This is because typically when you use ldif2db, the database is completely overwritten. (The exception to this is the configuration tree o=NetscapeRoot which you can choose not to overwrite during initialization.)
For information on consumer initialization, see "Initializing Consumers". For information on the online consumer creation process, see "Online Consumer Creation".
To manually initialize or reinitialize a server:
Create a replication agreement as described in "Creating an SIR Agreement" or "Creating a CIR Agreement". When prompted, select the "Create consumer initialization file" radio button.
Import the LDIF file to the consumer server. See "Importing the LDIF File to the Consumer Server" for instructions.
Converting the Supplier Tree to LDIF
You can convert the tree to LDIF when you create a replication agreement by selecting "Create consumer initialization file" on the Consumer Initialization dialog in the Replication wizard. (See "Creating an SIR Agreement" or "Creating a CIR Agreement" for information.)
If you choose not to export the tree at that time, you can:
Importing the LDIF File to the Consumer Server
Create your consumer server's database from the LDIF file by using either the Import command from the server console, or the ns-slapd ldif2ldbm command-line utility. For more information, see "Importing LDIF From the Server Console", or "Importing LDIF From the Command Line".
If your consumer server contains data that is also mastered either by itself or by some other supplier server, then use the online consumer creation process (for details, see "Online Consumer Creation"). While it is possible to manually import this LDIF file, you must do so using ldapmodify which offers no performance improvement over online consumer creation because both mechanisms add entries over LDAP.
If you decide that you must manually initialize a consumer that contains data mastered by some other server than your supplier server, make sure you do the following:
- Create any entries that are parents of the replicated subtree on the consumer server before adding the replicated data. That is, if you are replicating l=Minneapolis, ou=Global, o=airius.com, make sure that you have created ou=Global, o=airius.com and o=airius.com on your consumer server before running the add operation.
- If you are reinitializing a consumer server, make sure you delete all of the contents of the replicated tree before running the add operation. If you do not delete the currently existing replicated tree, the server will fail the add operations, stating that the entries already exist.
- When you are adding or deleting replicated entries, bind to your consumer server using the supplier DN configured for that server. If you use any other DN (including the root DN), the consumer server will simply refer the modify operation to the supplier server.