Skip to main content Skip to complementary content

An example of how to set up a load balancing solution using Apache httpd and mod_jk

The following example shows one way of connecting MDM Server instances by setting up a load balancing solution using mod_jk with Apache Tomcat. It assumes that you already have some experience of working with httpd and have some knowledge of Apache Tomcat and Apache Tomcat connectors (mod_jk).

Such a cluster consists of one Apache server that dispatches all the incoming requests across the cluster, and two "nodes", which are different instances of MDM Server installed on the same machine.

Procedure

  1. Edit the configuration file <Apache_home>/conf/httpd.conf.
  2. Add the following lines:
    JkMount /talendmdm/* loadbalancer
    JkMountCopy all
  3. Create a new file worker.property and populate it as follows:
    Make sure the workers listed for worker.loadbalancer.balance_workers correspond to names specified for jvmRoute in the file <TomcatPath>/conf/server.xml because Apache server will dispatch the requests based on the file worker.property.
    # Define mdm_node1
    worker.mdm_node1.port=8109
    worker.mdm_node1.host=127.0.0.1
    worker.mdm_node1.lbfactor=1
    worker.mdm_node1.type=ajp13
    
    # Define mdm_node2
    worker.mdm_node2.port=8009
    worker.mdm_node2.host=127.0.0.1
    worker.mdm_node2.lbfactor=1
    worker.mdm_node2.type=ajp13
    
    # Declare the load balancer itself and all the worker nodes
    worker.loadbalancer.type=lb
    worker.loadbalancer.balance_workers=mdm_node1,mdm_node2
    worker.list=mdm_node1,mdm_node2,loadbalancer
    worker.loadbalancer.sticky_session=true
    Information noteNote: You can find the AJP port of each MDM server node in the file <TomcatPath>/conf/server.xml. You need to uncomment the AJP port configuration if it is commented out. One example is shown below:
    <!-- Define an AJP 1.3 Connector on port 8109 -->
    <Connector port="8109" protocol="AJP/1.3" redirectPort="8543" address="0.0.0.0" secretRequired="false" />
  4. Restart the Apache server for the configuration to be taken into account.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!