Configuring the load balancer

You must configure the load balancer so that it can find and communicate with the Spotfire Statistics Services cluster.

Procedure

  1. Install an Apache HTTP Server.
  2. Install the mod_jk module. For more detailed instructions on adding modules to Apache HTTP Server, see the Apache HTTP Server documentation.
  3. Edit the workers.properties file to add the following properties and values. This file is usually located in the Apache HTTP Server configuration directory. If this file is not present, you must create it and then add the settings.
    # Define worker list
    # (All workers with additional exposed applications 
    # must also be added here, and do not forget to add 
    # the corresponding JkMount option in mod_jk.conf!)
    worker.list=jkstatus, loadbalancer
    # Example: the /admin application on worker1 should 
    # be exposed through the load balancer 
    # worker.list=jkstatus, loadbalancer, worker1
    
    # Set status
    worker.jkstatus.type=status
    
    # Set properties for the load balancer
    worker.loadbalancer.type=lb
    worker.loadbalancer.balance_workers=worker1, worker2
    
    # Set properties for worker1 (ajp13)
    worker.worker1.type=ajp13
    worker.worker1.host=[Managernode1_name]
    worker.worker1.port=[Managernode1_port]
    worker.worker1.max_packet_size=65536
    worker.worker1.lbfactor=1
    
    # Set properties for worker2 (ajp13)
    worker.worker2.type=ajp13
    worker.worker2.host=[Managernode2_name]
    worker.worker2.port=[Managernode2_port]
    worker.worker2.max_packet_size=65536
    worker.worker2.lbfactor=1

    You must change [Managernode1_name] to the hostname or IP address of the first Manager node, and [Managernode2_name] to the name of your second Manager node. In every instance of the worker.workern.port property, you must specify the port number that you set as the Main Service Port when you installed the first Manager node. If you want to add an additional Manager node, copy the Set properties for workern (ajp13) section and modify the values as needed.

  4. Add the following lines to the mod_jk.conf file. If the file is not present, you must create the file and then add the settings.
    # Load the mod_jk module
    LoadModule jk_module modules/mod_jk.so
    
    # Load the workers configuration
    JkWorkersFile conf/workers.properties
    
    # The mod_jk module's log file
    JkLogFile logs/mod_jk.log
    
    # The mod_jk module's log level 
    # (trace, debug, info, warn, error)
    JkLogLevel info
    
    # Let the load balancer worker handle all requests 
    # to the TSS web applications
    JkMount /<service_name> loadbalancer
    JkMount /<service_name>/* loadbalancer
    # replace <service_name> with the name of 
    # your server instance.
    
    # Define Apache environment variables to be 
    # exported by mod_jk to Tomcat web applications
    JkEnvVar REMOTE_USER
    JkEnvVar SSL_CLIENT_CERT
    #JkEnvVar SSL_CLIENT_CERT_CHAIN
    #JkEnvVar SSL_CLIENT_S_DN
    #JkEnvVar SSL_CLIENT_S_DN_CN
  5. The Apache HTTP Server configuration must include mod_jk.conf. For example, if mod_jk.conf is in the same directory as the Apache HTTP Server configuration, httpd.conf, add Include conf/mod_jk.conf.
  6. Restart the Apache HTTP Server. Check for any errors that were generated when the system started.
  7. Open a web browser and, in the address bar, send a request for the nodes in the cluster by using http://servername:port/<service_name>/api/v8/nodes, where servername:port corresponds to the load balancer name and port. Scan the XML for nodeType="Manager" and make sure that all of your Manager nodes are in the list.