Routing operations from a single client to a specific set of servers
About this task
To create a type of server affinity where all operations from a single client are routed to a specific set of servers, follow a similar process as in the previous task, but configure connection criteria instead of request criteria. These connection criteria identify clients that could be impacted by replication latency. These clients use the failover load-balancing algorithm rather than the default fewest operations load-balancing algorithm.
For example, an administrative tool includes a delete user
function. If the application immediately re-queries the directory for an updated list of users, the just-deleted entry must not be included.
To configure a criteria-based load balancing algorithm:
Steps
-
Create the new failover load-balancing algorithm using
dsconfig
with thecreate-load-balancing-algorithm
option.The failover load-balancing algorithm should list the same set of servers as the existing fewest operation load-balancing algorithm.
Example:
dsconfig create-load-balancing-algorithm \ --algorithm-name client_one_routing_algorithm \ --type failover --set enabled:true \ --set backend-server:east1.example.com:389 \ --set backend-server:east2.example.com:389
-
To route operations from a single client to a single server in a set of replicated servers, create connection criteria using
dsconfig
with thecreate-connection-criteria
option.Example:
dsconfig create-connection-criteria \ --criteria-name "Client One" --type simple \ --set included-user-base-dn:cn=Client One,ou=Apps,dc=example,dc=com
-
Configure a criteria-based load balancing algorithm and assign it to the proxying request processor, using
dsconfig
with thecreate-criteria-based-load-balancing-algorithm
option.Use the load balancing algorithm and connection criteria created in steps 1-2.
Example:
dsconfig create-criteria-based-load-balancing-algorithm \ --algorithm-name dc_example_dc_com-client-operations \ --set load-balancing-algorithm:dc_example_dc_com-failover \ --set "request-criteria:Client One Requests"
-
Assign the new criteria-based load balancing algorithm to the proxying request processor using
dsconfig
with theset-request-processor-prop
option.Example:
dsconfig set-request-processor-prop \ --processor-name dc_example_dc_com-req-processor \ --add criteria-based-load-balancing-agorithm:dc_example_dc_com-client-operations