Connect Keycloak with External Infinispan cache server

Hi, I’m trying to setup a Keycloak clusters - Standalone-HA

2 Keycloak server with 1 Infinispan server and 1 Postgresql db

I’m not sure how to configure both Keycloak 10.0.2 and Infinispan server version 11 using the management console.

Please help me.

Thanks,
Sathish

hello sathish,
did you configure the external infinispan cluster with keycloak, i am trying to configure it but still no luck.

@wahba @sathish hello. Have you configured External Infinispan cluster with Keycloak?)

Hi All,

I’m trying to do the same. Here is what I did, but there are issues. Please share if you are able to do this. Thanks!

In Standalone-ha.xml, modified the work, sessions, authentcationsSession, clientSessions, offlineClientSession, loginFailures and actionTokens caches as below (example is for “work” cache):

<replicated-cache name="work">
    <remote-store cache="work" remote-servers="remote-cache" passivation="false" fetch-state="false" purge="false" preload="false" shared="true">
         <property name="rawValues">true</property>
         <property name="marshaller">org.keycloak.cluster.infinispan.KeycloakHotRodMarshallerFactory</property>
         <property name="protocolVersion">2.9</property>
    </remote-store>
</replicated-cache>

  Also, added this to the <socket-binding-group> 

<outbound-socket-binding name="remote-cache"> 
   <remote-destination host="35.223.218.139" port="11222"/> 
 </outbound-socket-binding>

BTW, 35.223.218.139 is the external IP of the Infinispan cluster and the cluster itself is working now (verified by curl post and get).

Hi everyone,
I already configure it and you can check keycloak and infnispan cluster configurations here
https://github.com/Mu-Wahba/keycloak-for-production

I am using keycloak v11-0-0 and infinispan-server-11.0.1.Final.

Has anyone tried setting this up on a kubernetes cluster? I have deployed keycloak on an EKS cluster and now want to use external infinispan with it!