Sun Java System Directory Server Enterprise Edition 6.0 Administration Guide

Configuring Load Balancing

For information about load balancing, see Load Balancing in Sun Java System Directory Server Enterprise Edition 6.0 Reference. This section explains how to configure load balancing and provides sample configurations.

ProcedureTo Select a Load Balancing Algorithm

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

  1. Obtain the current load balancing algorithm by viewing the properties of the LDAP data source pool.


    $ dpconf get-ldap-data-source-pool-prop -h host -p port pool-name
    

    The default properties of an LDAP data source pool are as follows:


    client-affinity-policy    :  write-affinity-after-write
    client-affinity-timeout   :  20s
    description               :  -
    enable-client-affinity    :  false
    load-balancing-algorithm  :  proportional

    By default, the load balancing algorithm is proportional.

  2. Configure the LDAP data source pool to use an algorithm.


    $ dpconf set-ldap-data-source-pool-prop -h host -p port pool-name \
      load-balancing-algorithm:selected-algorithm
    

    where selected-algorithm is one of the following:

    • failover

    • operational-affinity

    • proportional

    • saturation

    For more information about the algorithms, see Introduction to Load Balancing in Sun Java System Directory Server Enterprise Edition 6.0 Reference.

  3. Restart the instance of Directory Proxy Server.


    $ dpadm restart instance-path
    

ProcedureTo Configure Weights for Load Balancing

You need to configure the weights of an attached data source in relation to the weights of any other attached data sources in the data source pool. Consider the weights of all of your attached data sources. If a data source has a weight of disabled for a type of operation, requests of that type are never sent to that data source. If a data source has a weight of 0 (zero), no requests are distributed to that data source unless all other data sources are unavailable. Therefore, data sources configured with a weight of 0 are used only when all other data sources are down.

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

  1. View the list of data sources that are attached to the data source pool.


    $ dpconf list-attached-ldap-data-sources -h host -p port pool-name
    
  2. View the properties of one of the attached data sources.


    $ dpconf get-attached-ldap-data-source-prop pool-name \
     attached-data-source-name
    

    The properties of an attached data source define the weight for each type of operation. The default weights of an attached data source are as follows:


    add-weight        :  disabled  
    bind-weight       :  disabled  
    compare-weight    :  disabled  
    delete-weight     :  disabled  
    modify-dn-weight  :  disabled  
    modify-weight     :  disabled  
    search-weight     :  disabled 
  3. Configure the weights of one of the attached data sources.


    $ dpconf set-attached-ldap-data-source-prop -h host -p port pool-name \
     attached-data-source-name add-weight:value \
     bind-weight:value compare-weight:value delete-weight:value \
     modify-dn-weight:value modify-weight:value search-weight:value
    
  4. Repeat Step 2 and Step 3 for the other attached data sources.

  5. Compare the key parameters of the attached data sources.


    $ dpconf list-attached-ldap-data-sources -h host -p port -v pool-name
    

    For example, a data source pool can contain data sources with the following weights:


    $ dpconf list-attached-ldap-data-sources -h host1 -p 1389 -v myPool
    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

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.0 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.0 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.0 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.0 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.0 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