Configuring assured replication
About this task
It is common for all servers to have the same policy. The following example, which demonstrates the configuration of various assured replication policies, assumes that three servers are configured on localhost, on ports 1389, 2389, and 3389.
|
In this example, each server has a default Replication Assurance Policy with no assurance levels set. |
Steps
-
To create request criteria for
addoperations on server 1, rundsconfigwith thecreate-request-criteriaoption.This request criteria is used to match any
addoperation with the Replication Assurance Policy that is configured in the following step.Example:
$ bin/dsconfig create-request-criteria \ --criteria-name Adds \ --type simple \ --set operation-type:add -
To make all add operations assured with a level of
processed-all-serverson server 1, set up the Replication Assurance Policy usingdsconfigand specify theAddsrequest criteria configured in the previous step.The
processed-all-serverslevel indicates that all local servers in the topology must complete replay of the replication update before the response is sent to the client.Example:
$ bin/dsconfig create-replication-assurance-policy \ --policy-name "Adds Processed All Locally" \ --set evaluation-order-index:1 \ --set local-level:processed-all-servers \ --set "timeout:500ms" \ --set request-criteria:Adds -
On server 1, repeat steps 1-2 for
modifyoperations.The Replication Assurance Policy
Mods Received Any Locallyensures that at least one available local server must receive a replication modify update before a response is sent to the client.Example:
$ bin/dsconfig create-request-criteria \ --criteria-name Mods \ --type simple \ --set operation-type:modify $ bin/dsconfig create-replication-assurance-policy \ --policy-name "Mods Received Any Locally" \ --set evaluation-order-index:2 \ --set local-level:received-any-server \ --set "timeout:500ms" \ --set request-criteria:Mods -
To set up the
AddsandModsrequest criteria and a Replication Assurance Policy on server 2, repeat steps 1-3.Example:
$ bin/dsconfig create-request-criteria \ --criteria-name Adds \ --type simple \ --set operation-type:add $ bin/dsconfig create-request-criteria \ --criteria-name Mods \ --type simple \ --set operation-type:modify $ bin/dsconfig create-replication-assurance-policy \ --policy-name "Adds Received Any Locally" \ --set evaluation-order-index:1 \ --set local-level:received-any-server \ --set "timeout:500ms" \ --set request-criteria:Adds $ bin/dsconfig create-replication-assurance-policy \ --policy-name "Mods Processed All Locally" \ --set evaluation-order-index:2 \ --set local-level:processed-all-servers \ --set "timeout:500ms" \ --set request-criteria:ModsLeave server 3 with the default Replication Assurance Policy configured with no assurance levels or criteria. In practice, it is common for all servers to have the same assurance levels or criteria.
-
To list the policies on server 1 to confirm that they exist, run
dsconfigwith thelist-replication-assurance-policiesoption.Example:
$ bin/dsconfig list-replication-assurance-policies -
Repeat step 5 for server 2 and server 3.
Server 3 should only show the Default Replication Assurance Policy.
-
To check the Replication Assurance counters on all servers before any
addormodifyoperation, useldapsearch.The counters should be set to zero. These counters are on the replica server where the policy is matched and assigned.
Example:
For this example, on server 1, run the following command.
$ bin/ldapsearch --baseDN "cn=Replica dc_example_dc_com,cn=monitor" \ "(objectclass=*)" | grep replication-assurance replication-assurance-local-completed-normally: 0 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0 -
To check the Replication Summary table on all of the servers, use
ldapsearch.Example:
For this example, on server 1, run the following command.
$ bin/ldapsearch --baseDN "cn=Replication Summary dc_example_dc_com,cn=monitor" \ "(objectclass=*)" | grep replication-assurance replication-assurance-submitted-operations: 0 replication-assurance-local-completed-normally: 0 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0 -
To add an entry to server 1 on the PingDirectory server, use
ldapmodify.The counters should match the newly added entry to the
Adds Processed All Locallypolicy and complete assured.Example:
$ bin/ldapmodify --filename add-user.ldif --defaultAdd $ bin/ldapsearch --baseDN "cn=Replica dc_example_dc_com,cn=monitor" \ "(objectclass=)" | grep replication-assurance replication-assurance-submitted-operations: 1 replication-assurance-local-completed-normally: 1 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0 replication-assurance-policy-matches: Adds Processed All Locally: 1 replication-assurance-policy-matches: Default Replication Assurance Policy: 0 replication-assurance-policy-matches: Mods Received Any Locally: 0 replication-assurance-local-level-uses: processed-all-servers: 1 replication-assurance-remote-level-uses: none: 1 $ bin/ldapsearch --baseDN "cn=Replication Summary dc_example_dc_com,cn=monitor" \ "(objectclass=)" | grep replication-assurance replication-assurance-submitted-operations: 1 replication-assurance-local-completed-normally: 1 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0 -
Perform a
modifyof an entry underdc=example,dc=comon server 1.The counters should match the
modifyoperation to theMods Processed All Locallypolicy and the operations should complete assured.Example:
$ bin/ldapsearch --baseDN "cn=Replica dc_example_dc_com,cn=monitor" \ "(objectclass=)" | grep replication-assurance replication-assurance-submitted-operations: 2 replication-assurance-local-completed-normally: 2 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0 replication-assurance-policy-matches: Adds Processed All Locally: 1 replication-assurance-policy-matches: Default Replication Assurance Policy: 0 replication-assurance-policy-matches: Mods Received Any Locally: 1 replication-assurance-local-level-uses: processed-all-servers: 1 replication-assurance-local-level-uses: received-any-server: 1 replication-assurance-remote-level-uses: none: 2 $ bin/ldapsearch --baseDN "cn=Replication Summary dc_example_dc_com,cn=monitor" \ "(objectclass=)" | grep replication-assurance replication-assurance-submitted-operations: 2 replication-assurance-local-completed-normally: 2 replication-assurance-local-completed-abnormally: 0 replication-assurance-local-completed-with-timeout: 0 replication-assurance-local-completed-with-shutdown: 0 replication-assurance-local-completed-with-unavailable-server: 0 replication-assurance-remote-completed-normally: 0 replication-assurance-remote-completed-abnormally: 0 replication-assurance-remote-completed-with-timeout: 0 replication-assurance-remote-completed-with-shutdown: 0 replication-assurance-remote-completed-with-unavailable-server: 0Result:
You have successfully configured Assured Replication.