I’ve setup 2 standalone-ha virtual machines with a shared database and a http/https load balancer in front. If I log in with the 2 vm up and then power off one of them, when I refresh the page it takes me back to login page. So the session is not being preserved. What can I do to solve it?
Hi,
I’ve got a similar setup and I had to do the following to make infinispan to share the sessions:
(1) in standalone-ha.xml, infinispan section, set owners=“2” (or higher value) on the entries. As I remember, the default value is “1”, which is useless.
(2) add to the standalone startup script the parameters -bprivate={IP_OF_NODE_X} -Djboss.node.name={NAME_OD_NODE_X} -Djboss.tx.node.id={NAME_OF_NODE_X} where X is the numer of your node…
(3) in bin/standalone.conf set -Xmx2G (or higher), because infinispan tends to do no garbage collection on expired sessions (keycloak version 13.0.1)
I run an apache proxy in AJP-mode in front of each node. Both apaches are pointing to both keycloaks, havng an additional hardware load balancer (F5 BIG IP) in front of the apaches. In case of a keycloak maintenance (or VM reboot/crash…), users will not recognize the absence of the machine.
Bye, Matthias
This is the same question/thread from the OP he already started here: How does each node know about each other in ha mode?
sorry, I read the other (older) question after this one… why do users open different threads to the same question…
THANK YOU SO MUCH. IT WORKED! It´s preserving the session!