Setting up a Partial Replication

Use this information to set up a partial replication.

Partial replication is a replication feature that replicates only the specified entries and a subset of attributes for the specified entries within a subtree. The entries and attributes that are to be replicated are specified by the LDAP administrator. Using partial replication, an administrator can enhance the replication bandwidth depending on the deployment requirements. For instance, an administrator may choose the entries of the object class person with cn, sn, and userPassword attributes to be replicated and description attribute not to be replicated.

The attributes that are to be replicated are specified using a replication filter. A replication filter may be associated with a particular replication agreement and will be based on object classes. A set of attributes pertaining to an object class constitutes a replication filter. The list of attributes selected for an object class can either be a part of an inclusion list or an exclusion list. An inclusion list is list of attributes that will be selected for replication while an exclusion list is list of attributes that will not be selected for replication.

The following attributes are always replicated, irrespective of their presence in the exclusion list
  • Object class attributes of an entry
  • Naming attribute
  • All operational attributes

For information about known limitations of partial replication, see Chapter 10, "General Information, Known Limitations and General Troubleshooting" in the IBM Tivoli Directory Server Version 6.1 Problem Determination Guide

The partial replication feature can be managed using the web administration tool or from the command line.

Using Web Administration Tool

If you have not done so already, expand the Replication managementcategory in the navigation area of the Web Administration Tool and click Manage filters. This panel is available only if the server supports the filter-based replication capability.

On this panel you can:
  • View subtrees where replication filters are stored
  • Add filters
  • Edit filters
  • Delete filters
  • Copy filters
  • View filters

Add filters

To add a replication filter, first select a subtree from the Select a subtree box on the Manage filters panel and then click Addto display the Add Replication Filter panel.

Add Replication Filter- General

This panel contains controls for adding details for a replication filter.

To add a replication filter:
  1. In the Filter name box, enter a name for the filter. For example, myfilter1.
  2. From the Available object classes box, select the object classes on which you want to create filter.
  3. Click Addto populate the Selected object classes box with the object classes from the Available object classes box.
  4. Select the Define filter for remaining object classes check box.
  5. To continue with adding a replication filter for filtered attributes, click Next.

Add Replication Filter- Filtered Attributes

This panel provides the facility to choose the attributes to be replicated for the selected object classes. This panel is invoked on clicking the Nextbutton on the Add Replication Filter- General panel.

To specify the attributes to be replicated for an object class:
  1. Click the Select column of the object class row for which you want to specify attributes to be replicated.
  2. Click 2. Click the Manage filter attributebutton or select Manage filter attribute from the Select Action list and then click Go.

Manage filter attributes

The Manage filter attributes panel is used for specifying object class attributes for replication filter

To specify attributes for replication filter:
  1. Click the Select all attributes as filtered attributescheck box.
    Note: If you want to specify all the attributes of the selected object class in a replication filter, select the Select all attributes as filtered attributescheck box.
  2. Select the required attributes in the Available attributes box
  3. Click Add move the selected attributes from Available attributes to Filtered attributes.
  4. To include the attributes in the Filtered attributes box in the replication filter, click Include selected filtered attributes.
  5. To exclude the attributes in the Filtered attributes box from the replication filter, click Exclude selected filtered attributes.
  6. Click OK
  7. To save the replication filter, click Finishon the Add Replication Filter- Filtered Attributes panel.

Delete filters

To delete a replication filter, select a replication filter in the Filters for selected subtree box on the Manage filters panel and then click Delete.

Edit filters

To edit a replication filter, select a filter from the Filters for selected subtree box on the Manage filters panel and then click Edit.

Edit Replication Filter- General

This panel contains controls for modifying the content of a selected filter.

To edit a replication filter:
  1. From the Available object classes box, select the object classes that you want to add to the filter.
  2. To edit the existing filter:
    1. Click Add to populate the Selected object classes box with the object classes from the Available object classes box.
    2. Click Remove to remove a selected object class from the Selected object classes box.
  3. Select the filter for remaining object classes check box.
  4. To editing the replication filter for filtered attributes, click Next.

Edit Replication Filter- Filtered Attributes

This panel provides the facility to choose the attributes to be replicated, when the filter is selected. This panel is invoked on clicking the Next button on the Edit Replication Filter- General panel.

To specify the attributes to be replicated for an object class:
  1. Click the Select column of the object class row for which you want to edit the existing attributes list for the selected object class in the replication filter.
  2. Click the Manage filter attribute button or select Manage filter attribute from the Select Action list and then click Go to display the Manage filter attributes panel.
  3. In the Manage filter attributes panel, specify the attributes that are to be included or excluded in the replication filter definition.

Copy Filters

To copy the details of a replication filter to another replication filter, first select a subtree from the Select a subtree box and then select a filter stored under that subtree from Filters for selected subtree on the Manage filters panel and then click Copy.

Copy Replication Filter- General

To copy a replication filter:
  1. From the Filter location box, select the subtree under which you want to copy the selected replication filter.
  2. In the Filter name box, enter a name for the filter. For example, myfilter2.
  3. From the Available object classes box, select the object classes that you want to add to the existing filter.
  4. ClickAdd to populate the Selected object classes box with the object classes from the Available object classes box.
  5. Select the Define filter for remaining object classes check box.
  6. To continue with copying of the filter for filtered attributes, click Next.

Copy Replication Filter- Filtered Attributes

This panel provides the facility to choose the attributes to be replicated for the selected object classes. This panel is invoked on clicking the Next button on the Copy Replication Filter- General panel.

To specify the attributes to be replicated for an object class:
  1. Click the Select column of the object class row for which you want to specify attributes to be replicated.
  2. Click the Manage filter attribute button or select Manage filter attribute from the Select Action list and then click Go to display the Manage filter attributes panel.
  3. In the Manage filter attributes panel, specify the attributes that are to be included or excluded in the replication filter definition.

Using command line

Issue the following command to add a replication filter:
ldapadd -D cn=root -w root 

dn: cn=replicationfilter,cn=localhost
objectclass: ibm-replicationfilter
ibm-replicationFilterAttr: (objectclass=person):(cn,sn,description)
ibm-replicationFilterAttr: (objectclass=printer):!(cn,color)
ibm-replicationFilterAttr: (objectclass=*): (*)

The above example states that for entries of type "person", the attributes cn, sn, and description will be sent to the replica. The rest of the attributes present in the entry will not be sent. For entries of type "printer", all attributes except cn and color will be sent. For the remaining entries, all attributes will be sent.

Now, modify the replication agreement to add the DN of the filter entry. To do this, issue the following command:
ldapmodify -D cn=root -w root 

dn: cn=replica1,ibm-replicaServerId=master-uuid,ibm-replicaGroup=default,o=sample
changetype: modify
add: ibm-replicationFilterDN
ibm-replicationFilterDN: cn=replicationfilter,cn=localhost

Examples of replication filter

Given below are some examples that explain the usage of replication filter.

Example 1
dn: cn=replicationfilter, cn=localhost
objectclass: ibm-replicationFilter
ibm-replicationFilterAttr: (objectclass=person):(*)
ibm-replicationFilterAttr: (objectclass=*): !(*) 

The first filter attribute in this example specifies that all attributes of entry type "person" will be replicated. The second filter attribute specifies that no other entries except those of type "person" will be replicated. This means that only entries of type "person" will be replicated and no other entries will be replicated.

Example 2
objectclass: ibm-replicationFilter
ibm-replicationFilterAttr: (objectclass=person):(cn,sn,userPassword)
ibm-replicationFilterAttr: (objectclass=managerOf):(managerOfDept)
ibm-replicationFilterAttr: (objectclass=*): !(managerOfDept)

For this example, consider an entry "cn=Ricardo Garcia,o=sample" of type "person". A new auxiliary objectclass "managerOf" is attached to the above entry. Therefore the entry "cn=Ricardo Garcia,o=sample" will contain both "person" and "managerOf" object classes.

The first filter attribute specifies that attributes cn, sn, and userpassword of entry type "person" will be replicated. The second filter attribute specifies that attribute managerOfDept of entry type "managerOf" will be replicated. The third filter attribute specifies that attribute managerOfDept will not be replicated for any other entry except those of type "person" or "managerOf".

Therefore, for an entry type person, the attribute cn, sn, and userPassword will be replicated. For the entry "cn=Ricardo Garcia,o=sample", containing objectclass person and managerOf, the attributes cn, sn, userPassword, and managerOfDept will be replicated. For any other entry that is not of type "person" or "managerOf", all attributes except managerOfDept will be replicated.

Example 3
dn: cn=replicationfilter, cn=localhost
objectclass: ibm-replicationFilter
ibm-replicationFilterAttr: (objectclass=person):(cn,sn,userPassword)
ibm-replicationFilterAttr: (objectclass=inetOrgPerson):!(userPassword,employeeNumber)
ibm-replicationFilterAttr: (objectclass=*): !(*)

For this example, consider an entry "cn=Ricardo Garcia,o=sample" of type "person" and another entry "cn=Jane Smith,o=sample" of type "inetOrgperson". The entry "cn=Jane Smith,o=sample" will contain both "person" and "inetOrgPerson" object classes

The first filter attribute specifies that attributes cn, sn, and userpassword of entry type "person" will be replicated. The second filter attribute specifies that attributes userPassword and employeeNumber of entry type "inetOrgPerson" will not be replicated. The third filter attribute specifies that any attribute for any other entry except that of type "person" or "inetOrgPerson" will not be replicated.

Therefore, for the entry "cn=Ricardo Garcia,o=sample", the attributes cn, sn, and userPassword will be replicated. For the entry "cn=Jane Smith,o=sample", which matches the first and second replication filters, only attributes cn and sn will be replicated. The attribute userPassword being present in both the inclusion and exclusion list, will be eliminated as exclusion takes precedence over inclusion. For any other entry, that is not of type "person" or "inetOrgPerson" no attributes will be replicated.