このコンテンツは選択した言語では利用できません。
Chapter 2. Configuring referrals to redirect requests to other hosts or entries
Referrals inform client applications to perform the operation on a different host, suffix, or entry. These pointers help maintain high availability and directory integrity by ensuring that requests for non-existent entries or offline databases redirect to active resources rather than failing.
In Red Hat Directory Server, replication handles the suffix level referrals. With the dsconf utility, you can add, delete, and list referrals for a replicated suffix.
The replicated suffix returns a referral in the following cases:
- When the server attempts to perform a write operation over a read-only replica.
- When the server attempts to perform an operation over a busy replica, for example, when an import or reindex task is in progress.
Prerequisites
- The destination of the referral exists.
- You have root permissions.
Procedure
Add a referral for a replicated suffix by using the
dsconfcommand with the--repl-add-refoption:# dsconf <server1_instance_name> replication set --suffix="ou=people,dc=example,dc=com" --repl-add-ref="ldap://server2.example.com:389"The command sets the referral for the
ou=people,dc=example,dc=comsuffix on theserver1.example.comhost that points to theserver2.example.comhost.Delete a referral for a replicated suffix by using the
dsconfcommand with the--repl-del-refoption:# dsconf <server1_instance_name> replication set --suffix "ou=people,dc=example,dc=com" --repl-del-ref ldap://server2.example.com:389The command deletes the referral that points to the
server2.example.comhost.
Verification
List referrals for the replicated suffix:
# dsconf <server1_instance_name> replication get --suffix "ou=people,dc=example,dc=com" | grep nsDS5ReplicaReferralnsDS5ReplicaReferral: ldap://server2.example.com:389
2.2. Redirect requests for non-existent DNs to a different directory by using a default referral リンクのコピーリンクがクリップボードにコピーされました!
Set up a default referral as a fallback solution when clients access a distinguished name (DN) that does not exist in the directory. This global redirect guides the client to a different LDAP server to continue the search.
This can occur, for example, after a migration to Red Hat Directory Server (RHDS) with a new directory structure. If a client application still expects the old directory structure, the default referral redirects these requests to the previous LDAP server when the application accesses DNs that do not exist.
Prerequisites
- The LDAP directory RHDS refers to exists.
- You have root permissions.
Procedure
Add the default referral:
# dsconf <server1_instance_name> config replace nsslapd-referral="ldap://server2.example.com/"The command adds a default referral to RHDS instance on server1, and if a client searches for an entry that does not exist, RHDS redirects the request to
server2.example.com.
Verification
Search for a non-existent DN by using an LDAP client that can handle LDAP referrals.
Note that the OpenLDAP client utilities do not support following LDAP referrals. For example, a search using the
ldapsearchutility returns only the referral information and not the actual result from the destination directory:# ldapsearch -H ldap://server1.example.com -x -D "cn=Directory Manager" -W -b "dc=<non_existent_DN>,dc=example,dc=com"... # search result search: 2 result: 10 Referral ref: ldap://server2.example.com/
2.3. Redirect requests for a specific entry to a different host or entry by using smart referrals リンクのコピーリンクがクリップボードにコピーされました!
Configure smart referrals to automatically redirect a client request for an entry or a tree to a different LDAP server. The destination of the referral can be in the same directory or on a different host.
To use smart referrals, the entry you want to redirect, requires:
-
The
referralobject class -
The
refattribute set to the destination LDAP URL
The procedure updates an existing directory entry. Red Hat Directory Server (RHDS) then redirects requests for this entry to an entry on a different host.
Prerequisites
- The destination of the referral exists.
- You have root permissions.
Procedure
Add the
referralobject class and therefattribute to the entry that requires a redirect:# ldapmodify -D "cn=Directory Manager" -W -H ldap://server1.example.com -x << EOF dn: uid=example,ou=People,dc=example,dc=com changetype: modify add: objectclass objectclass: referral - add: ref ref: ldap://server2.example.com/uid=demo,ou=People,dc=example,dc=com EOFmodifying entry "uid=example,ou=People,dc=example,dc=comThe
ref: ldap://server2.example.com/uid=demo,ou=People,dc=example,dc=comstatement in theuid=example,ou=People,dc=example,dc=comentry defines that RHDS redirects requests foruid=example,ou=People,dc=example,dc=comto theuid=demo,ou=People,dc=example,dc=comentry onserver2.example.com.
Verification
Search the entry that contains the newly added referral using an LDAP client that can handle referrals:
Note that the OpenLDAP client utilities do not support following LDAP referrals. For example, a search using the
ldapsearchutility returns only the referral information and not the actual result from the destination directory:# ldapsearch -H ldap://server1.example.com -x -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com"... # search result search: 2 result: 10 Referral ref: ldap://server2.example.com/uid=demo,ou=People,dc=example,dc=com
2.4. Redirect requests for a non-replicated suffix to a different host or entry by using the command line リンクのコピーリンクがクリップボードにコピーされました!
By using a suffix referral, you can redirect requests from a non-replicated suffix and its sub-entries to a specific LDAP URL. The destination of the referral can be in the same directory or on a different host.
For example, configure a referral for the ou=People,dc=example,dc=com non-replicated suffix on server1.example.com. After the referral is configured, Red Hat Directory Server redirects requests for this suffix and sub-entries to the ou=users,dc=example,dc=com entry on server2.example.com.
Prerequisites
- The destination of the referral exists.
- You have root permissions.
Procedure
Optional: Identify the suffixes and databases that are already in use:
# dsconf <server1_instance_name> backend suffix list dc=example,dc=com (userroot) ...The name in parentheses is the database that stores the data of the corresponding suffix. You must choose a unique database name for the new sub-suffix in the next step.
Create the sub-suffix:
# dsconf <server1_instance_name> backend create --suffix="ou=people,dc=example,dc=com" --be-name="people" --parent-suffix="dc=example,dc=com"The command creates the
ou=people,dc=example,dc=comsub-suffix along with thepeopledatabase, under thedc=example,dc=comparent suffix.Add the referral to the
peopledatabase that holds the suffix you want to redirect:# dsconf <server1_instance_name> backend suffix set --add-referral="ldap://server2.example.com:389/ou=users,dc=example,dc=com" peopleUpdate the
peopledatabase status:# dsconf <server1_instance_name> backend suffix set --state=referral people
Verification
Use an LDAP client that can handle LDAP referrals, and search for the entry that contains the referral.
Note that the OpenLDAP client utilities do not support following LDAP referrals. For example, a search using the
ldapsearchutility returns only the referral information and not the actual result from the destination directory:# ldapsearch -H ldap://server1.example.com -x -D "cn=Directory Manager" -W -b "ou=people,dc=example,dc=com"... # search result search: 2 result: 10 Referral ref: ldap://server2.example.com/ou=users,dc=example,dc=com
2.5. Redirect requests for a non-replicated suffix to a different host or entry by using the web console リンクのコピーリンクがクリップボードにコピーされました!
By using a suffix referral, you can redirect requests for a non-replicated suffix and its sub-entries to a specific LDAP URL. The destination of the referral can be in the same directory or on a different host.
For example, configure a referral for the ou=People,dc=example,dc=com non-replicated suffix on server1.example.com. After the referral is configured, Red Hat Directory Server (RHDS) redirects requests for this suffix and sub-entries to the ou=users,dc=example,dc=com entry on server2.example.com.
Prerequisites
- The destination of the referral exists.
- You are logged in to the instance in the web console.
Procedure
- Open the Database menu.
Create the sub-suffix that RHDS must redirect:
- Select an entry from the Suffixes list to which you want to add the sub-suffix.
-
Click
. -
Enter the first part of the sub-suffix distinguished name (DN),
ou=People, and a database name, suchpeople. -
In the Initialization Option field, select
Create The Top Suffix-Entry. - Click .
Create the referral for the new sub-suffix:
- Select the newly created sub-suffix from the list.
- Navigate to the Referrals tab and click .
Fill in the fields to create the referral URL:
- Click .
Update the database state:
- Select the sub-suffix from the list.
-
On the Settings tab, select
Referralfrom the Backend State field. - Click Save Configuration.
Verification
Use an LDAP client that can handle LDAP referrals, and search for the entry that contains the referral.
Note that the OpenLDAP client utilities do not support following LDAP referrals. For example, a search using the
ldapsearchutility returns only the referral information and not the actual result from the destination directory:# ldapsearch -H ldap://server1.example.com -x -D "cn=Directory Manager" -W -b "ou=people,dc=example,dc=com" ... # search result search: 2 result: 10 Referral ref: ldap://server2.example.com/ou=users,dc=example,dc=com