Versions Compared

Key

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

...

  • Some users have had problems using a load-balancer-assigned cookie and trying to use it for request routing.  One approach that works well is to route based on the JSESSIONID cookie assigned by Tomcat.

Logging User IPs instead of Load Balancer IPs

One issue that may arise when configuring a load-balanced uPortal service is logs filled with the load balancer IPs. This is frustrating in that logs lose important, valuable information. This can be corrected if the load balancer has a mechanism to add the user's remote IP in a header. The header 'x-forwarded-for' is defined for this purpose. Once the load balancer is configured to add this header, Tomcats can then use a Valve to use this IP value.

Code Block
languagexml
     <Valve className="org.apache.catalina.valves.RemoteIpValve"
               internalProxies="169\.236\.45\.28, 169\.236\.89\.28"
               remoteIpHeader="x-forwarded-for"
               remoteIpProxiesHeader="x-forwarded-by"
               protocolHeader="x-forwarded-proto" />

In the example above, the load balancers have IPs of 169.236.45.28 and 169.236.89.28. 

Load Distribution

There are a number of algorithms for load distribution, none of them perfect.  Refer to your load balancer documentation for supported methods and additional guidance, including using pool groups (clusters at different data centers, for example) or weighting multiple factors.  

...