Versions Compared

Key

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

JIRA

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKNOX-843

The default HA functionality works on a simple round robin algorithm which can be configured to run in the following modes:

  • The top of the list of URLs is used to route all of a service’s REST calls until a connection error occurs (Default).
  • Round robin all the requests, distributing the load evenly across all the HA url’s (enableLoadBalancing)
  • Round robin with sticky session, requires cookies, requires enableLoadBalancing enabled. Here, only new sessions will round robin ensuring sticky sessions. In case of failure next configured HA url is picked up to dispatch the request which might cause loss of session depending on the backend implementation (enableStickySession).
  • Round robin with sticky session and no fallback, depends on enableStickySession and enableLoadBalancing to be true. Here, new sessions will round robin ensuring sticky sessions. In case of failure, Knox returns http status code 502. By default noFallback is turned off (noFallback).


Load-balancing Behavior Matrix

The following table list what the expected output should be based on the config flags discussed above. config matrix



Config Options


Result



enableLoadBalancing

(default=false)

enableStickySession

(default=false)

noFallback

(default=false)

stickySessionCookieName

(default=KNOX_BACKEND-{serviceName})

Should Loadbalance

Should Fallback

(failover)

Comments
N/Adepends on enableLoadBalancingdepends on enableStickySession
noFallback
depends on enableStickySession
stickySessionCookieName



falsefalsefalseN/Anoyessticky sessions disabled because loadbalancing is disabled
falsetruefalseN/Anoyessticky sessions disabled because loadbalancing is disabled
falsetruetrueN/Anoyessticky sessions disabled because loadbalancing is disabled
truefalsefalseN/Ayesyes
truetruefalseCookieNameyes (only on new session w/o sticky cookie)yes
  • Fallback since noFallback=false
  • Sticky session cookie name is "CookieName"
truetruetrueN/Ayes (only on new session w/o sticky cookie)noSticky session cookie name is "KNOX_BACKEND-{serviceName}"