THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
JIRA:
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
andenableLoadBalancing
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 Options | Result | |||||
---|---|---|---|---|---|---|
enableLoadBalancing (default=false) | enableStickySession (default=false) | noFallback (default=false) | stickySessionCookieName (default=KNOX_BACKEND-{serviceName}) | Should Loadbalance | Should Fallback (failover) | Comments |
N/A | depends on enableLoadBalancing | depends on enableStickySession | depends on enableStickySession | |||
false | false | false | N/A | no | yes | sticky sessions disabled because loadbalancing is disabled |
false | true | false | N/A | no | yes | sticky sessions disabled because loadbalancing is disabled |
false | true | true | N/A | no | yes | sticky sessions disabled because loadbalancing is disabled |
true | false | false | N/A | yes | yes | |
true | true | false | CookieName | yes (only on new session w/o sticky cookie) | yes |
|
true | true | true | N/A | yes (only on new session w/o sticky cookie) | no | Sticky session cookie name is "KNOX_BACKEND-{serviceName}" |