[keycloak-user] Keycloak 3.4.3 Failover with session replication

Libor Krzyžanek lkrzyzan at redhat.com
Tue Feb 13 04:20:54 EST 2018


Hi,
we’re upgrading keycloak from 1.9. to 3.4 and caches changed quite a lot.

The setup is simply two nodes in HA mode. I see that nodes see each other but it’s not clear to me what is the easiest way how to achieve failover with session replication. In KC 1.9 we just increased owners=2 and it was enough.

We tried the default setup with distributed-caches (most of them have owners=“1”) and when one node is killed (not shutdown.sh but hard java kill) then user lost session and is asked to login again once LB forward traffic to second node. 

We tried to increase owners on these caches
            <distributed-cache name="sessions" mode="SYNC" owners="2"/>
            <distributed-cache name="offlineSessions" mode="SYNC" owners="2"/>
but with no luck.

I read this article: http://blog.keycloak.org/2017/09/cross-datacenter-support-in-keycloak.html <http://blog.keycloak.org/2017/09/cross-datacenter-support-in-keycloak.html> but we don’t have JDG because it’s just simple cluster with two nodes within same datacenter.

What is the best and easiest approach to achieve failover with session replication?

Thanks,

Libor

Libor Krzyžanek
Principal Software Engineer
Middleware Engineering Services



More information about the keycloak-user mailing list