12.3. Adding the Distribution Function to Your Directory

To declare the distribution function to your directory, you need to add multiple databases to a single suffix and then declare the distribution function in the suffix.
These procedures assume you have already created a suffix and associated it with a single database. For the procedure on creating a new suffix and database, refer to the Creating Directory Entries chapter in the Red Hat Directory Server Administration Guide.

Note

You need to add all of the databases required for your distribution algorithm before you deploy entry distribution. You cannot add more databases later without changing the algorithm. Whenever you install new distribution functions, ensure that you restart the Directory Server. Otherwise, the new libraries will not be loaded properly.

12.3.1. Adding Multiple Databases to a Single Suffix

12.3.1.1. Using the Console

The following procedure describes how to add multiple databases to a suffix using the Console.
  1. In the Directory Server Console, select the Configuration tab.
  2. Expand the Data tree, and select the suffix to which you want to add another database.
  3. From the Object menu, select New Database. You can also right click the suffix and select New Database from the menu.
    The Create New Database dialog box appears.
  4. Enter the name of the newdatabase in the Database Name field.
  5. In the Create database in field, enter the path to the location where the data for your new database will be stored.
    You can also click Browse to locate the path on your local machine.
  6. Click OK to save your changes.
A warning message displays telling you to declare a distribution function in the suffix. The next procedure describes how to declare the function in a suffix.

12.3.1.2. Using the Command-Line

The following procedure describes how to add multiple databases to a suffix using the command-line.
  1. Use the ldapmodify command-line utility to add another database to your directory configuration file. The database configuration information is stored in the cn=ldbm database,cn=plugins,cn=config entry.
    For example, to add a new database to the server example1, you add a new entry to the configuration file by performing an ldapmodify as follows:
    # ldapmodify -a -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
    The ldapmodify utility binds to the server and prepares it to add an entry to the configuration file.
  2. Create the entry for the new database as follows:
    dn: cn=Data2,cn=ldbm database,cn=plugins,cn=config
    objectclass: extensibleObject
    objectclass: nsBackendInstance
    nsslapd-suffix: ou=people,dc=example,dc=com
    
    The entry added corresponds to a database named Data2 that contains the data for the root suffix ou=people,dc=example,dc=com.
    The database name, given in the DN attribute, must correspond with one of the values in the nsslapd-backend attribute of the suffix entry.

12.3.2. Adding Distribution Logic to a Suffix

The distribution logic is a function declared in a suffix. This function is called for every operation reaching this suffix, including the subtree search operations that start above the suffix. You can add a distribution function to a suffix using both the Console and the command-line.

12.3.2.1.  Using the Console

To use the Console to add a distribution function to a suffix:
  1. In the Directory Server Console, select the Configuration tab.
  2. Expand the Data tree, and select the suffix to which you want to add the distribution function.
  3. Select the Databases tab in the right pane.
  4. Click Add to add new databases to the suffix from the Database List.
  5. Enter the path to the distribution library in the Distribution Library field, or click Browse to locate the library on your local machine.
  6. Enter the name of your distribution function in the Function Name field.
  7. Click Save to save your changes.

12.3.2.2.  Using the Command-Line

To use the Command-line to add a distribution function to a suffix:
Use the ldapmodify command-line utility to add the following lines to the suffix entry:
nsslapd-distribution-plugin: path_to_shared_library
nsslapd-distribution-funct: distribution_function_name
The first line provides the name of the library that your plug-in uses. The second line provides the name of the distribution function itself.