Child pages
  • Servoy Application Server Configuration for Load Balancing

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The load-balancing is done by serving the JNLP file from different servers when the Apache HTTP front-end is accessed. Add to each To make a Servoy Application Server work properly with the Apache HTTP Server and Load balancing, the following modifications to the configuration of the Servoy Application Server 's "servoy.properties" files the following line (needed for Smart Client load balancing):

servoy.jnlpCodebaseOverride=http://thisServersHostnameAsSeenByClients:portImage Removed
What you should also take into consideration when setting up a load-balanced cluster, is allowing smart-clients to connect directly to individual servers in the cluster. This means that all Servoy Application Servers should be accessible from the client side - and you might want to isolate the cluster so that connections to ports used by Terracotta (see tc-config.xml) are only allowed from within the cluster, even if connections from client machines on Servoy ports should be allowed to all Servoy Application Servers.

-------------

3. Using Apache HTTP Server for load-balancing

Using Apache HTTP server as a front-end to load-balance a cluster of Servoy Application Servers is optional. You should be able to do this in other ways, including custom balancing inside a Tomcat instance application or using other HTTP servers such as IIS that support (or have modules for) AJP1.3. Read through the section even if you do not plan to use Apache HTTP Server as it also shows configuration changes needed for Servoy Application Servers to run in a similar setup.

Smart clients will connect directly to the individual Servoy Application Servers in the cluster. The load-balancing are required:

AJP 1.3 connector

  • Open {servoyInstall}/application_server/server/conf/server.xml and make the following adjustments:
    • Change line '<Engine name="Catalina" defaultHost="localhost">' into '<Engine jvmRoute="servoy1" name="Catalina" defaultHost="localhost">'. The value of the jvmRoute atrribute needs to be different for each Servoy Application server and match with the list of workers registered with the Apache HTTP server (see Apache HTTP Server Configuration)
    • Add the following connector before the already declared one in both installations:

      Code Block
      <Connector port="8009"
         enableLookups="false" maxThreads="500" connectionTimeout="60000"
         redirectPort="8443" useBodyEncodingForURI="true" protocol="AJP/1.3"/>
      

When the Servoy Application Servers and the Apache HTTP Server is started, connecting clients will be automatically distributed over the configured Servoy Application Servers in a weighted round-robin load balancing with sticky sessions manner.

jnlpCodebaseOverride

Load-balancing of Smart Clients is done by serving the JNLP file from the different servers Servoy Application Servers when the Apache HTTP front-end is accessed. Add to each of the Servoy Application Server's "servoy.properties" files the following line (needed for Smart Client load balancing):The Apache HTTP Server serves the JNLP file to the requesting client and using the JNLP, the requesting client will connect directly to the Servoy Application Server that supplied the JNLP.

This means that each Servoy Application Server needs to be accessible to connecting client. Because of this, the external hostname/IP Address and port of the Servoy Application Server need to be registered as jnlpCodebaseOverride value. For more information, see Network Related Settings.

Code Block
servoy.jnlpCodebaseOverride=http://thisServersHostnameAsSeenByClients:port

What you should also take be taken into consideration when setting up a load-balanced cluster , is allowing smart-clients and allowing Smart Clients to connect directly to individual servers in the cluster . This means that all Servoy Application Servers should be accessible from the client side - and you might want to isolate is isolating the cluster so that connections to ports used by Terracotta (see tc-config.xml) are only allowed from within the cluster, even if connections from client machines on Servoy ports should be allowed to all Servoy Application Servers.