eplication and referrals are both important mechanisms for extending your directory service beyond a single server configuration. This chapter describes how you can use both replication and referrals for your directory service. This chapter contains the following sections:
Configuring Servers for Supplier-Initiated Replication
To configure servers for supplier-initiated replication, do the following:
Configuring Servers for Consumer-Initiated Replication
To configure servers for supplier-initiated replication, do the following:
Before you can create replication agreements, you have to configure your server to either be a supplier or a consumer (or both). To do this, you must configure basic information about the server.
Configuring the Supplier DN
If you are using supplier-initiated replication, you must configure a supplier DN and password for your consumer servers before they can be updated with replicated directory entries. The Supplier DN is a special distinguished name that does not actually exist in your directory tree. Instead, it is identified in your slapd.conf Supplier DN parameter.
Supplier servers use the supplier DN to bind to this server. Entries supplied to this server from another server can only be updated if the LDAP client binds as the supplier DN; all other update operations for the supplied data will be referred to the supplier server that masters the directory data. It is therefore important that the only LDAP clients that bind to this server using the supplier DN are supplier servers.
You can configure the server to accept normal bind operations from the supplier, or you can configure the server to accept certificate-based authentication. The following sections describe how to configure these two methods of authentication.
Configuring the Server to Accept Normal Authentication
Configuring the supplier DN and password pair that this server will accept from the supplier server is fairly straightforward. Simply provide a DN in the Supplier DN field and a password in the password fields. For this kind of authentication, you should leave the Supplier SSL Clients box empty.
After changing the values in these fields, you must apply your changes and then restart your server.
Configuring the Server to Accept Certificate-Based Authentication
Certificate-based authentication requires that you use SSL for server to server communications, and that both your supplier and consumer servers are configured to use the appropriate certificate.
For replication purposes, you must tell your consumer server what certificate(s) correspond to the supplier DN that you have defined for the consumer server. To do this, identify the supplier DN for the local server in the Supplier DN field just as you would for the normal authentication case. Leave the password fields blank, and in the Supplier SSL Clients box, enter the subject DN of the certificate that the supplier server will use to bind to this server. If you have more than one server supplying entries to this consumer, enter a subject DN for each supplier server. Each DN should be placed on a separate line in the dialog box.
You can find the subject DN of the certificate used by a supplier server by going to the supplier server's manager and looking at the bottom of the Server Preferences | Server On/Off form.
Related Topics
For security reasons, you are recommended to not configure anonymous access for your change log directory tree. Also, you should grant only read, search, and compare access to the DN that your consumers will bind to your supplier with; do not provide any form of write or delete access to this tree. Finally, for logging and auditing purposes, you may want to configure a different directory entry to be used by each consumer server for this purpose. This will allow you to track which consumer is binding to your server and when. Related Topics
Adding and Editing a Replication Agreement
To add a consumer of supplier-initiated agreements, go to Replica Config | Configure Replication Agreements on the supplier server. Under Supplier Initiated Agreements, click Add Consumer. To edit an existing agreement, highlight the agreement.
The Replication Editor now appears.
In the Nickname field at the top of the editor, enter a unique name representative of this agreement.
You now have three tabs that you use to add a new consumer: Destination, Content, and Schedule. A fourth tab, Status, allows you to track replication activity.
The Destination Tab
Use the Destination tab when you are setting up replication to identify the consumer to which you will replicate directory entries. Do the following:
Select "Always keep directories in sync" if you do not want the replication window to ever close.
The Status Tab
The Status tab allows you to see a log of replication activity. Use the Update button to refresh the display of this log.
Managing Consumer-Initiated Agreements
You manage consumer-initiated agreements from the Consumer Initiated Agreements area of the Replication Settings applet. From this area, you have access to the following buttons:
Adding and Editing a Replication Agreement
To add a consumer of supplier-initiated agreements, go to Replica Config | Configure Replication Agreements on the supplier server. Under Supplier Initiated Agreements, click Add Consumer. To edit an existing agreement, highlight the agreement.
The Replication Editor now appears.
In the Nickname field at the top of the editor, enter a name or short description that is representative of this agreement.
You now have three tabs that you use to add a new consumer: Source, Content, and Schedule. A fourth tab, Status, allows you to track replication activity.
The Source Tab
Use the Source tab when you are setting up replication to identify the supplier server from which your consumer will obtain directory entries. Do the following:
Select "Always keep directories in sync" if you do not want the replication window to ever close.
The Status Tab
The Status tab allows you to see a log of replication activity. Use the Update button to refresh the display of this log.
Initializing Consumers
After you have created a replication agreement, you must initialize the consumer. That is, you must physically move directory data from the supplier server to the consumer server so that changes can be replayed to consumer servers.
There are two ways that a consumer can be initialized:
copiedFrom attribute must also be placed on the replicated tree (see "Supplier-Initiated Replication Algorithm" or "Consumer-Initiated Replication Algorithm" for details).Once the tree has been physically placed on the consumer, the supplier server can begin begin replaying update operations to the consumer server. In addition, any attempts to modify data on the consumer that is owned by the supplier are referred to the supplier server. 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:
Change logs are trimmed based on the Maximum Changelog Age and Maximum Changelog Size parameters. For more information, see "Configuring the Change Log".
Inconsistency detected while replaying change <n>,This message will also indicate 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 that you are using. See "Online Consumer Creation" (next) or "Manual Consumer Creation" for more information.
entry <DN>, to replica <host>:<port>/<DN>
Note
When a consumer server is being initialized, 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. This is exactly the mechanism used by the supplier server to synchronize a consumer, and it requires very little action on your part to succeed. 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 details on creating replication agreements, see "Creating a Supplier- Initiated Agreement" or "Creating a Consumer-Initiated Agreement".
Online consumer creation begins immediately. You can find out if online consumer creation is finished by clicking the status tab. If online consumer creation is in progress, the status shows that a replica is being initialized. To update this window, you must click the Update button. When online consumer creation is finished, the status is changed to reflect this.
Note that you can configure your server to automatically reinitialize a consumer. 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 onThe
orcauto 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 significantly more complicated than the online manual creation process.
You should use the manual process whenever you find that the online process is inappropriate due to performance concerns. Also, 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 to it from a single supplier server. For more information, see "How to Perform Manual Consumer Creation".
For information on consumer initialization, see "Initializing Consumers". For information on the online consumer creation process, see "Online Consumer Creation".
How to Perform Manual Consumer Creation
To manually initialize or reinitialize a server:
To convert the local tree to LDIF, do the following on the supplier server:
For information on how to put your database into read-only mode, see "Placing Your Database in Read-Only Mode". Note that this process requires a server restart.
To import the LDIF file to the consumer server:
For more information, see "Importing LDIF Using the Server Manager", or "Importing LDIF from the Command Line".
It is important to note that you should never use this manual consumer creation process if your supplier server is mastering only part of the tree contained on the consumer server. This is because this process erases the consumer server's database which wipes out the rest of the consumer's tree. 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 are adding entries over LDAP.
You use the Replica Config | Configure Replication Agreements form to configure the supplier DN for a consumer server.
If no such attribute exists for the subtree, the supplier server:
If the
copiedFrom attribute identifies some server (server B) other than the
current supplier (server A), the supplier (server A) aborts synchronization and
returns an error. This prevents any one replicated entry on the consumer from
having multiple suppliers.
copiedFrom attribute is set correctly, the supplier compares version identification on the replicated tree against the supplier's change log to determine whether
the replicated tree needs to be updated. The change log is a log of all the changes
made to the supplier's entries. Among other things, this log contains version identification used for synchronization purposes.
copiedFrom attribute at the top of the replicated tree on the consumer server. This identifies the tree as being a replica and, more importantly, identifies the supplier server as the master of the information in that tree.
Consumer-Initiated Replication Algorithm
If you are using consumer-initiated replication, it is the responsibility of the consumer server to request updates from the supplier server. This process occurs as follows:
If no
copiedFrom attribute exists on the tree, the consumer server adds
one so that all write operations are appropriately referred to the supplier
server.
Machine data
By default, your database actually contains two distinct directory trees. The first is the tree that the server uses to manage your entries. This tree is represented by the Suffix you create when you initially install a directory server instance.
A second tree is also created when you install your directory server. This tree is used to contain machine data. The machine data tree contains two top-level entries that identify the local server. The first entry uses the NetscapeMachineData object class to identify the domain components of the machine on which the server is installed. The second entry uses the LDAPServer object class to identify the port on which the LDAP server is listening.
The machine data tree also contains zero or more entries that identify consumer or supplier servers. On the suppler server, the machine data tree contains an entry for each consumer server to which the server replicates data. These consumer server entries use object class LDAPReplica. On the consumer servers, the machine data tree contains an entry for each supplier server. The suppler server entries use object class cirReplicaSource.
See Appendix A, "Object Classes" for information on the NetscapeMachineData, LDAPServer, LDAPReplica, cirReplicaSource object classes.
The suffix for the machine data directory tree is
dc=<serverID>, dc=<domain>, dc=<domain_type>
For example, if your directory server is running on directory.airius.com, then the machine data suffix is
dc=directory, dc=airius, dc=com
Managing Referrals
Referrals are a redirection mechanism that are supported by the LDAP protocol. There are several reasons why a directory server might return a referral:
slapd.conf Referral parameter. The directory server determines whether this kind of a referral should be returned by comparing the DN of the requested directory object against the directory suffixes supported by the local server. If the DN and the supported suffixes do not match, the directory server will return a referral.
ldap://directory.airius.com:389/o=airius.com
directory.europe.airius.com.
You create and manage smart referrals by using ldapmodify (for information on ldapmodify, see "Modifying Entries Using ldapmodify"). To create a smart referral, create the relevant directory entry with the Referral object class. This object class allows a single attribute: ref. The ref attribute is expected to contain an LDAP URL. For example, to return a smart referral for the entry uid=bjensen, ou=people, o=airius.com, create the entry as follows:
dn: uid=bjensen, ou=people, o=airius.comNote that you can use the -m parameter with the command-line utilities to cause the server to not return the smart referral. For information on the -m parameter, see "Additional ldapmodify Parameters".
objectclass: top
objectclass: referral
ref: ldap://directory.europe.airius.com/cn=babs jensen, o=people,
l=europe, o=airius.com
For more information on smart referrals, see Chapter 8 of the Netscape Directory Server Deployment Guide. For information on LDAP URLs, see Appendix C, "LDAP URLs."