mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Mark Craig
10.40.2013 f0832f34a0f104f1f0fbf72d9d993a47d67b8ff5
CR-1532 Fix for OPENDJ-850: Dev guide section on load balancing and failover could be more complete
1 files modified
33 ■■■■■ changed files
opendj-sdk/opendj3/src/main/docbkx/dev-guide/chap-simple-proxy.xml 33 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj3/src/main/docbkx/dev-guide/chap-simple-proxy.xml
@@ -20,7 +20,7 @@
  !
  ! CCPL HEADER END
  !
  !      Copyright 2011-2012 ForgeRock AS
  !      Copyright 2011-2013 ForgeRock AS
  !    
-->
<chapter xml:id='chap-simple-proxy'
@@ -122,12 +122,41 @@
  of connection factories, such as those that you set up for connection
  pooling.</para>
  <para>The following excerpt shows how to set up round robin load balancing
  across directory servers.</para>
  <programlisting language="java"
>final RoundRobinLoadBalancingAlgorithm algorithm =
  >final List&lt;ConnectionFactory&gt; factories = new LinkedList&lt;ConnectionFactory&gt;();
// Set up a ConnectionFactory for each directory server in the pool as shown in
// the previous example, and then set up a load balancer.
final RoundRobinLoadBalancingAlgorithm algorithm =
        new RoundRobinLoadBalancingAlgorithm(factories);
final ConnectionFactory factory = Connections.newLoadBalancer(algorithm);</programlisting>
  <para>With multiple pools of directory servers, for example in a deployment
  across multiple data centers, also use fail over load balancing. Fail over
  load balancing directs all requests to the first (preferred) pool of servers
  until problems are encountered with the connections to that pool. Then it
  fails over to the next pool in the list. Therefore in each data center you
  can set up round robin load balancing, and then set up fail over load
  balancing across data centers.</para>
  <programlisting language="java"
  >// localFactory:  ConnectionFactory to servers in the local data center
// remoteFactory: ConnectionFactory for servers in a remote data center
// localFactory and remoteFactory use round robin load balancing "internally".
final List&lt;ConnectionFactory&gt; factories =
        Arrays.asList(localFactory, remoteFactory);
final FailoverLoadBalancingAlgorithm algorithm =
        new FailoverLoadBalancingAlgorithm(factories);
final ConnectionFactory factory = Connections.newLoadBalancer(algorithm);</programlisting>
  <para>The algorithms also include constructors that let you adjust timeouts
  and so forth.</para>
 </section>