How to maintain session affinity from TIBCO Spotfire Web Player to load balanced TIBCO Spotfire Statistics Services (TSSS) cluster.

How to maintain session affinity from TIBCO Spotfire Web Player to load balanced TIBCO Spotfire Statistics Services (TSSS) cluster.

book

Article ID: KB0077858

calendar_today

Updated On:

Products Versions
Spotfire Statistics Services All Versions

Description

With a load balancer in front of a TIBCO Spotfire Statistics Services (TSSS) cluster, in order to maintain state information to provide a continuous experience to Web Player users, sticky sessions must be enabled on the given load balancer (this is the responsibility of the load balancer administrators). This is a prerequisite when configuring a load balancer with a TSSS cluster. 

In addition to this, within Spotfire there are additional settings to be performed to return the cookie information that the load balancer uses to preserve session affinity.  Without this configuration in place, it may be seen that requests from the Web Player to the TSSS are hopping between the cluster nodes which may cause data functions to fail.

Here are example log excerpts where a data function request with job id 1379 was incorrectly sent to two different Manager nodes for a single user session:
  • SplusServer.log from Manager Node-1 having hostname as tsssMN1.boston.local :
2019-05-22 17:11:38,674 | DEBUG |  | ClusterMessageReceiverBase | Received message {ClusterNotificationAcknowledgementMessage message=S+SN|t=JobStatus|d=636652590984186913|sid=http://tsssMN1.boston.local/SplusServer|jid=1379|da=2}
  • SplusServer.log from Manager Node-2 having hostname as tsssMN2.boston.local:
2019-05-22 17:11:38,675 | DEBUG |  | ClusterMessageReceiverBase | Received message {ClusterNotificationAcknowledgementMessage message=S+SN|t=JobStatus|d=636652590984186913|sid= http://tsssMN2.boston.local/SplusServer |jid=1379|da=2}

 

Issue/Introduction

This article describes steps to be followed in the Spotfire configuration in order to maintain session affinity for communication from TIBCO Spotfire Web Player to load balanced TIBCO Spotfire Statistics Services (TSSS) cluster.

Resolution

To fix the issue, configure the Web Player to send back the cookie used by the load balancer for all requests. Then, if the load balancer is correctly configured for cookie based session affinity, the load balancer can now route all requests for a single session to the same TSSS node.

Follow the steps below.

1. Open a command-line interface and export the service configuration from Spotfire Server by using the export-service-config command. Specify the Web Player capability and the deployment area. Example:            
config export-service-config --capability=WEB_PLAYER --deployment-area=Production
The following configuration files will be exported. By default, these files are located in the <TSS install dir>\tomcat\bin\config\root directory.
  • Spotfire.Dxp.Worker.Core.config
  • Spotfire.Dxp.Worker.Host.exe.config
  • Spotfire.Dxp.Worker.Web.config


2.  Open the Spotfire.Dxp.Worker.Core.config file in a plain text editor, search for the following section in the file and configure the cookies' setting "autoTransfer" attribute.         

<!-- Cookies from the TIBCO Spotfire Server that should be sent back on all requests: -->
    <!-- a ; separated list, example: "ARRAffinity;myCookie;myCookie2" -->
    <cookies autoTransfer="" />

Your load balancer administrator can provide you with the cookie name to use here. For example: If it is AWS ELB load balancer then it relies on a cookie named "AWSALB" to preserve session stickiness (refer to AWS ELB for more information). In this example, the cookie AWSALB needs to be configured in the Spotfire.Dxp.Worker.Core.config file like:

<!-- Cookies from the TIBCO Spotfire Server that should be sent back on all requests: -->
    <!-- a ; separated list, example: "ARRAffinity;myCookie;myCookie2" -->
    <cookies autoTransfer="AWSALB" />

3.  Save the changes to file

4.  In the command-line interface, import the configuration file back into the Spotfire Server and name the configuration by using the import-service-config command.  Example: 

    
config import-service-config --config-name=SessionStickinessForTSSSLoadbalancer
  
      5. In the command-line interface, assign the created Spotfire Web Player configuration to the Spotfire Server to make it possible to use for the service: Example: 

     
config set-service-config --service-id=<value> –config-name= SessionStickinessForTSSSLoadbalancer


 

Additional Information

Doc:  Spotfire.Dxp.Worker.Core.config file > cookies autoTransfer="" Doc:  Manually editing the service configuration files External : AWS ELB load balancer Sticky Sessions using cookie AWSALB