The example uses as many databases as you like to contain the data. For
example, if you create 3 databases for a single suffix, entries starting with the
letters A-I to database 0, entries starting with the letters J-R go to database 1,
and entries starting with the letters S-Z go to database 2. If you create 26
databases, each database would receive the entries for one letter of the
alphabet.
•
Distributing entries based on a simple hash algorithm (hash_distribution).
In this example, entries are randomly distributed using a hash algorithm on the
RDN to compute the database to which the entry will be written.
•
Chaining entries to a read-write replica from a read-only replica
(chaining_distribution).
Usually the directory returns a referral to clients making update requests to a
read-only replica. This example uses a distribution function on a suffix that
contains both a read-only database and a database link. When the read-only
database receives an update request, it forwards the request using the database
link to a read-write database. The database link needs to be configured to chain on
update. For information on configuring database links, refer to Chapter 2,
"Creating Directory Entries," in the Netscape Directory Server Administrator's Guide.
The following directory in your Directory Server installation contains the
uncompiled C code examples:
<server_root>/plugins/slapd/slapi/examples/distb/
This directory contains a file named
functions (
alpha_distribution
chaining_distribution
Once you have compiled the source code, you will have the following files:
Solaris
distrib-plugin.so
AIX
distrib-plugin.a
HP-UX
distrib-plugin.sl
Windows NT
distrib-plugin.dll
Imagine you want to use the hash distribution function on a Solaris machine. First
create a suffix. Then create several databases under that suffix. Next, import the
suffix entry to each of the databases you created. Finally, add the following lines to
the suffix:
nsslapd-distribution-plugin: /plugin/distrib-plugin.so
nsslapd-distribution-funct: hash_distribution
distrib.c
,
hash_distribution
) and a Makefile for compiling them.
Chapter 12
Using the Distribution Logic Examples
, which contains three example
, and
Using the Custom Distribution Logic
153
Need help?
Do you have a question about the NETSCAPE DIRECTORY SERVER 6.01 - PLUG-IN and is the answer not in the manual?
Questions and answers