DDF Load Balancer

DDF Load Balancer


Contained within DDF is a Load Balancer utility that allows incoming traffic to be distributed over multiple instances of DDF. The DDF Load Balancer supports two protocols, HTTP and HTTPS. The Load Balancer can be configured to run either protocol or both at the same time. The DDF Load Balancer has been configured to utilize a "Round Robin" algorithm to distribute transactions. The load balancer is also equipped with a failover mechanism. When the load balancer attempts to access a server that is non-functional, it will receive an exception and move on to the next server on the list to complete the transaction.

Setting up the DDF Load Balancer

 

There are two methods for standing up a DDF Load Balancer. The standalone load balancer distribution that is pre-built may be used or the load balancer can be added to the full DDF distribution.

Setting up the Pre-Built Standalone DDF Load Balancer

 

When a DDF build occurs, a distribution of the load balancer is created on top of a lightweight version of DDF. After building DDF, this distribution can be found under <DDF-BUILD>/distribution/ddf-standalone-loadbalancer/target. The build file will be an archive called standalone-loadbalancer.zip. Unziping this file into a directory will provide you with a DDF instance specifically designed to only run the load balancer. This instance will have the DDF Load Balancer already installed and running.  Start the DDF instance as normal.

 

Setting up the DDF Load Balancer On the Full Distribution

 

The following steps will help in getting the load balancer to run on a full DDF distribution. It is recommended that the load balancer run on a dedicated machine and not be utilized for any other DDF service activity other than for load balancing.

 

  • Start your instance of the DDF framework

  • Open the DDF management console by navigating to http://<serverip>:8181/system/console/features in a web browser, where serverip is the IP address or host name of your DDF instance. You may have to fill in credentials (username and password) to access the console.

  • Within the “Features” table on the current page, scroll down until you see a feature labeled “camel-jetty”. Install this feature by clicking on the circular button located at the far right of the current row.

  • Navigate back to the top of the page and click on the “Bundles” tab in the main navigation.

  • To install the load balancer bundle, click the “Install/Update” button located just above the table.

  • Click the checkbox for start bundle and then click on the “choose file” button. From here, select the jar file located under <DDF_INSTALL_DIRECTORY>/cloud/loadbalancer/target/cloud-loadbalancer.jar.

  • Click the “Open” button to select it and then click the “Install or Upgrade” button.

  • You should now see the service marked active in the table.

 

Configuring the DDF Load Balancer


The DDF Load Balancer can be configured to allow for multiple DDF nodes to be balanced across it. It can also be configured with a particular port on which to accept connections. Configurations differ slightly between the HTTP and HTTPS based load balancers. All configurations are dynamic in that configuration settings are immediately applied and no restart of DDF is necessary.

Configuring the HTTP Load Balancer


To access the load balancer configuration, follow the steps below:

  • From the DDF management console, click on the "Configuration" tab in the main navigation.
  • Within the configuration table, scroll down to the configuration entry labeled Platform HTTP Load Balancer. There will be two entries. Click on the 1st entry that is in non-italics.
  • The configuration for the load balancer contains two fields: Load Balancer Port and IP Address and Port.
  • For Load Balancer Port, enter the port number which you would like to access on your load balancer to reach the other systems.
  • For IP Address and Port, enter a comma delimited list of IP address and port for each DDF node that will be balanced. The format for IP address and port is the following: <IP_ADDRESS>:<PORT> (e.g. 192.168.1.123:8181,192.168.1.22:8181)
  • Once all configurations have been added, click the save button.


At this point, the load balancer should reset and should be ready to accept requests. These configurations can be updated at any time without starting the host DDF instance.

Configuring the HTTPS Load Balancer

It is possible to run the HTTPS load balancer by itself or run it in parallel with the HTTP load balancer. The HTTPS load balancer utilizes the centralized SSL configurations within DDF, along with the load balancer configurations. To configure the HTTPS load balancer, follow the steps below:

  • First step is to find the SSL configurations and check that the values are correct.
  • From the DDF management console, click on the "Configuration" tab in the main navigation.
  • Within the configuration table, scroll down to the configuration entry labeled Pax Web Runtime. Click on this entry.
  • Ensure that these settings are in sync with what you have configured for your DDF nodes that will be balanced. Save settings or close window.
  • Next, within the configuration table, scroll down to the configuration entry labeled Platform HTTPS Load Balancer. There will be two entries. Click on the 1st entry that is in non-italics.
  • The configuration for the load balancer contains three fields: Load Balancer Host, Load Balancer Port and IP Address and Port.
  • For Load Balancer Host, enter the host name or IP address that should be used for the host load balancer machine.
  • For Load Balancer Port, enter the port number which you would like to access on your load balancer to reach the other systems.
  • For IP Address and Port, enter a comma delimited list of IP address and port for each DDF node that will be balanced. The format for IP address and port is the following: <IP_ADDRESS>:<PORT> (e.g. 192.168.1.123:8993,192.168.1.22:8993)
  • Once all configurations have been added, click the save button.


Note: Since SSL requests will be coming from a client into the load balancer, it is essential that the nodes being balanced have the same security policy and settings. The client has no idea which DDF server it will be connecting with behind the load balancer. The client is responsible for connecting securely with the load balancer and the load balancer is responsible for connecting securely and consistently with all DDF nodes.

 

Note: The DDF Load Balancer cannot run on the same port as the DDF Web Console or other web services. If you would like the load balancer to run on this port, you must change the web console port to a different port number. This configuration parameter can be found in the "Pax Web Runtime" configuration.