Goal
This document explains how to configure a Denodo cluster in BigIP F5 in order to distribute the load between several nodes.
Content
Health check configuration in BigIP F5
In order to set up the health check in BigIP F5, we need to define a monitor in the configuration of the load balancer. The external monitors need to return anything to the standard output when the server is healthy. We will use the ping script of Denodo to build the custom health monitor.
The Denodo ping script is distributed with the Denodo Platform and it allows users to check whether a Virtual DataPort server is running. It can be found not only in the $DENODO_HOME/bin folder but also packed with other administration tools as being part of the denodo-db-tools.
The syntax for invoking this script requires to provide at least the Denodo VDP server that is going to be pinged:
ping [-t timeout] [ -q <query> -l <login> -p <password> ] [-v] <host>[:<port>][/<database name> |
Syntax of the ping script
To use Denodo’s health check script in BigIP F5 we will need to create an “External Monitor” in the Monitors section of the Main tab of the configuration screen:
- Unzip $DENODO_HOME/tools/db/denodo-db-tools.zip in /usr/bin/monitors in the load balancer’s file system. Permissions on the file ping.sh (located in the folder denodo-db-tools/bin) must be 700 or better; granting root rwx privileges to the file.
- Create a new file containing the code below in /usr/bin/monitors in the load balancer’s file system, then name it as “monitor_denodo” for instance. Permissions on the file must be 700 or better; granting root rwx privileges to the file
#!/bin/sh # These arguments are supplied automatically for all external pingers: # $1 = IP (nnn.nnn.nnn.nnn notation or hostname) # $2 = port (decimal, host byte order) # $3 and higher = additional arguments # node_ip=`echo $1 | sed 's/::ffff://'` pidfile="/var/run/pinger.$node_ip..$2.pid" if [ -f $pidfile ] then kill -9 `cat $pidfile` > /dev/null 2>&1 fi cd /usr/bin/monitors/denodo-db-tools/bin JAVA_HOME=/usr/java/openjdk # JAVA_HOME=/usr/java/jre_version/ in case we have installed a new JVM #echo "sh /usr/bin/monitors/denodo-db-tools/bin/ping.sh -t 2000 -v $node_ip:9999 " >$pidfile status=`. /usr/bin/monitors/denodo-db-tools/bin/ping.sh -t 2000 -v $node_ip:9999 2>/dev/null | grep OK | wc -l` if [ "$status" -eq "1" ] then # Remove the pidfile before the script echoes anything to stdout and is killed by bigd rm -f $pidfile echo "up" fi # Remove the pidfile before the script ends rm -f $pidfile |
Denodo External Monitor Script Template
- Once the script is ready it can be imported by browsing to the following menu and selecting the monitor file:
System > File Management > External Monitor Program File List
Java compatibility
Depending on the Denodo version and the BigIP F5 version, the Java version used by both tools may be compatible or not. A BigIP F5 balancer using an older Java version than Denodo may not be able to execute this script.
For this configuration the previous template can be modified so the JAVA_HOME variable points to a Java installation compatible with the Java version of BigIP F5.
- Install the Java version needed in the load balancer machine.
- Then, update the external monitor file replacing the value for JAVA_HOME:
JAVA_HOME=/usr/java/openjdk
with
JAVA_HOME=/usr/java/jrex.y.z_xxx/ /* the new path */
Using Dynamic Ratio as a load balancing strategy in BigIP F5
Dynamic Ratio load balancing is a special load balancing mode for which the BigIP system actively polls pool members and assigns a weight value to each individual member based on a set of default or user-defined threshold values. The weight assigned to an individual pool member determines how much traffic the pool member receives. The higher the value of the weight, the more traffic is directed to the pool member and the lower the value, the less traffic is directed to the pool member. The weights assigned to the pool members are dynamic and can change with each polling cycle that the snmp_dca or the snmp_dca_base monitors perform.
The configuration of the dynamic ratio strategy in BigIP F5 requires several steps:
- Configure the SNMP agents in the JVM and operative system.
- In the load balancer, create SNMP DCA BASE monitors.
- Select “Dynamic Ratio (node)” as the balancing strategy.
In the following sections you can find the details for each one of these steps. More information on this balancing strategy can also be found here:
http://support.f5.com/kb/en-us/solutions/public/9000/100/sol9125.html
Check memory heap size usage with an SNMP agent
NOTE: These instructions are only valid for Denodo version previous to Denodo 8.0.
Edit the management.properties file located in DENODO_HOME/jre/lib/management with the following values
- com.sun.management.snmp.port=161 (agent port)
- com.sun.management.snmp.interface=0.0.0.0 (allow petitions from any machine)
- com.sun.management.snmp.acl=false
To configure a SNMP monitor to check the heap size used by the JVM running in the node:
- In the navigation panel, click on ‘Local Traffic’ and select ‘Monitors’ → ‘Create’.
- Select type ‘SNMP DCA BASE’.
- Add following user variables to check used heap in remote JVM.
- jvmHeapUsed = .1.3.6.1.4.1.42.2.145.3.163.1.1.2.11.0
- jvmHeapUsed_threshold = 80000000
- jvmHeapUsed_coefficient = 1
Check CPU usage in a Windows node with an SNMP agent
First we have to install the SNMP agent on Windows. The following instructions work for Windows Server 2003, 2003 SP1, SP2 and 2003 R2. Other versions of Windows may require a different process:
- Start → Control Panel → Programs and Features → Turn Windows features on or off.
- Select ‘Simple Network Management Protocol (SNMP)→ WMI SNMP Provider’ and click ‘OK’.
- In the components wizard click ‘Next’ and later ‘Finish’.
- SNMP agent configuration:
- The installation process creates the services ‘SNMP Service’ and ‘SNMP Trap Service’. To modify the configuration of these services go to Start → Control Panel → Administrative Tools → ‘Services’.
- Right-click on one of the services and click ‘Properties’.
- In the security tab, add 'public' community with READ ONLY privileges and the hosts list from which SNMP packets will be accepted.
- If the services are not started automatically, Right-click → ‘Start’
To configure the SNMP monitor to check CPU usage in a windows server node with the SNMP agent provided by Microsoft:
- Open the navigation panel → Click on ‘Local Traffic’ and select ‘Monitors’ → ‘Create’.
- Select type ‘SNMP DCA BASE’.
- Add following user variables to check cpu usage.
- cpu = .1.3.6.1.2.1.25.3.3.1.2.2
- cpu_threshold = 40
- cpu_coefficient = 1
Sending TCP Keep-Alives to client applications in BigIP F5 using TCP profiles
When the BigIP system load-balances or forwards long-lived TCP connections, on environments with a lot of heavy processing and long-running queries, the long-lived TCP connections between client applications and the Denodo Platform Cluster need to be managed by the BigIP.
Some server applications send TCP Keep-Alive packets to maintain those long-lived connections with a client and, although this is not the approach used by the Denodo Servers, the BigIP system can be used as the server that sends the TCP Keep-Alive packets to the client applications and handle in this manner the long-lived TCP connections.
So, in order to prevent the clients from timing out or disconnecting because of a lack of response within a reasonable time frame, the BigIP systems will send a TCP Keep-Alive packet to the client playing the server role in this server-client TCP Keep-Alives communication. For that purpose F5 recommends configuring a custom client-side TCP profile as follows:
- Log in to the Configuration utility.
- Navigate to ‘Local Traffic’ → ‘Profiles’ → ‘Protocol’.
- Select ‘TCP’.
- Click ‘Create’.
- Type a name for the profile, for example: “Custom_Client_TCP”.
- Check the box next to ‘Keep Alive Interval’.
- Specify the amount of time, in seconds, that the BigIP system should send a TCP Keep-Alive packet to the client.
- Select ‘Finished’.
- Apply the custom TCP profile to the virtual server that is handling the load balancing of the server application.
For further information regarding the implementation of TCP Keep-Alives for server-client communication using TCP profiles see https://support.f5.com/kb/en-us/solutions/public/8000/000/sol8049.html?sr=49036270
References
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.