Sun Java System Directory Server Enterprise Edition 6.2 Administration Guide

Example Configurations for Load Balancing

This section contains sample procedures for configuring each of the load balancing algorithms.

ProcedureTo Configure the Proportional Algorithm for Load Balancing

For a description of the proportional algorithm, see Proportional Algorithm for Load Balancing in Sun Java System Directory Server Enterprise Edition 6.2 Reference.

In this example, the data source ds–1 is configured with twice the weight of the other two data sources.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

Before You Begin

Ensure that you have a data source pool with at least three attached data sources. For information about how to create data sources and data source pools, see Chapter 20, LDAP Data Sources and Data Source Pools.

  1. Configure the data source pool to use the proportional algorithm for load balancing.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
      load-balancing-algorithm:proportional
  2. Configure the properties of the first data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-1 \
     add-weight:2 bind-weight:2 compare-weight:2 delete-weight:2 modify-dn-weight:2 \
     modify-weight:2 search-weight:2
  3. Configure the properties of the second data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-2 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  4. Configure the properties of the third data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-3 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    Name add-weight bind-weight compare-weight delete-weight modify-dn-weight modify-weight search-weight
    ---  ---------- ----------- -------------- ------------- ---------------- ------------- -------------
    ds-1 2          2           2              2             2                2             2
    ds-2 1          1           1              1             1                1             1
    ds-3 1          1           1              1             1                1             1
  6. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path
    

ProcedureTo Configure the Saturation Algorithm for Load Balancing

For a description of the saturation algorithm, see Saturation Algorithm for Load Balancing in Sun Java System Directory Server Enterprise Edition 6.2 Reference.

In this example, the data source ds-1 performs the majority of bind operations but does not perform any other types of operations. The three data sources are configured with the following weights :

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

Before You Begin

Ensure that you have a data source pool with at least three attached data sources. For information about how to create data sources and data source pools, see Chapter 20, LDAP Data Sources and Data Source Pools.

  1. Configure the data source pool to use the saturation algorithm for load balancing.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
     load-balancing-algorithm:saturation
  2. Configure the properties of the first data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-1 \
     add-weight:disabled bind-weight:3 compare-weight:disabled delete-weight:disabled \
     modify-dn-weight:disabled modify-weight:disabled search-weight:disabled
  3. Configure the properties of the second data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-2 \
     add-weight:2 bind-weight:2 compare-weight:2 delete-weight:2 modify-dn-weight:2 \
     modify-weight:2 search-weight:2
  4. Configure the properties of the third data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-3 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    Name add-weight bind-weight compare-weight delete-weight modify-dn-weight modify-weight search-weight
    ---  ---------- ----------- -------------- ------------- ---------------- ------------- -------------
    ds-1 disabled   3		       disabled       disabled      disabled         disabled      disabled
    ds-2 2          2           2              2             2                2             2
    ds-3 1          1           1              1             1                1             1
  6. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path
    

ProcedureTo Configure the Operational Affinity Algorithm for Global Account Lockout

For a description of this algorithm, Operational Affinity Algorithm for Global Account Lockout in Sun Java System Directory Server Enterprise Edition 6.2 Reference.

This example has three data sources. The data source ds-1 is configured to receive all bind requests.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

Before You Begin

Ensure that you have a data source pool with at least three attached data sources. For information about how to create data sources and data source pools, see Chapter 20, LDAP Data Sources and Data Source Pools.

  1. Configure the data source pool to use the operational affinity algorithm.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
     load-balancing-algorithm:operational-affinity
  2. Configure the properties of the first data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-1 \
     add-weight:1 bind-weight:100 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  3. Configure the properties of the second data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-2 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  4. Configure the properties of the third data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-3 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    Name add-weight bind-weight compare-weight delete-weight modify-dn-weight modify-weight search-weight
    --   ---------- ----------- -------------- ------------- ---------------- ------------- -------------
    ds-1 1          1           1              1             1                1             1
    ds-2 1          100         1              1             1                1             1
    ds-3 1          1           1              1             1                1             1
  6. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path
    

ProcedureTo Configure Operational Affinity Algorithm for Cache Optimization

For a description of this algorithm, see Operational Affinity Algorithm for Cache Optimization in Sun Java System Directory Server Enterprise Edition 6.2 Reference.

This example has three data sources. All search and compare operations are treated by the data source ds-1. When ds-1 responds to a request, the targeted entry is stored in the cache. If ds-1 responds repeatedly to the same request, the data source can use cached data.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

Before You Begin

Ensure that you have a data source pool with at least three attached data sources. For information about how to create data sources and data source pools, see Chapter 20, LDAP Data Sources and Data Source Pools.

  1. Configure the data source pool to use the operational affinity algorithm.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
     load-balancing-algorithm:operational-affinity
  2. Configure the properties of the first data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-1 \
     add-weight:1 bind-weight:1 compare-weight:100 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:100
  3. Configure the properties of the second data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-2 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  4. Configure the properties of the third data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-3 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    Name add-weight bind-weight compare-weight delete-weight modify-dn-weight modify-weight search-weight
    ---  ---------- ----------- -------------- ------------- ---------------- ------------- -------------
    ds-1 1          1           100            1             1                1             100
    ds-2 1          1           1              1             1                1             1
    ds-3 1          1           1              1             1                1             1
  6. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path
    

ProcedureTo Configure the Failover Algorithm for Load Balancing

For a description of the failover algorithm, see Failover Algorithm for Load Balancing in Sun Java System Directory Server Enterprise Edition 6.2 Reference.

This example has three data sources. The data source ds-1 receives all requests. If ds-1 fails, ds-2 receives all requests until ds-1 recovers. If ds-2 fails before ds-1 recovers, ds-3 receives all requests.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

Before You Begin

Ensure that you have a data source pool with at least three attached data sources. For information about how to create data sources and data source pools, see Chapter 20, LDAP Data Sources and Data Source Pools.

  1. Configure the data source pool to use the failover algorithm for load balancing.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
     load-balancing-algorithm:failover
  2. Configure the properties of the first data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-1 \
     add-weight:3 bind-weight:3 compare-weight:3 delete-weight:3 modify-dn-weight:3 \
     modify-weight:3 search-weight:3
  3. Configure the properties of the second data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-2 \
     add-weight:2 bind-weight:2 compare-weight:2 delete-weight:2 modify-dn-weight:2 \
     modify-weight:2 search-weight:2
  4. Configure the properties of the third data source.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name ds-3 \
     add-weight:1 bind-weight:1 compare-weight:1 delete-weight:1 modify-dn-weight:1 \
     modify-weight:1 search-weight:1
  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    Name add-weight bind-weight compare-weight delete-weight modify-dn-weight modify-weight search-weight
    ---  ---------- ----------- -------------- ------------- ---------------- ------------- -------------
    ds-1 3          3           3              3             3                3             3
    ds-2 2          2           2              2             2                2             2
    ds-3 1          1           1              1             1                1             1
  6. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path