Hi Guys,
I am trying to setup Keycloak Quarkus in cluster mode. Below is my cache config file:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:13.0 http://www.infinispan.org/schemas/infinispan-config-13.0.xsd"
xmlns="urn:infinispan:config:13.0">
<jgroups>
<stack name="encrypt-tcp" extends="tcp">
<TCP bind_port="7600"/>
<dns.DNS_PING dns_query="service-headless"
stack.combine="REPLACE"
stack.position="MPING"/>
<FD_SOCK start_port="57600"
stack.combine="REPLACE"
stack.position="FD_SOCK"/>
<!-- configure security for communication -->
<!-- SSL_KEY_EXCHANGE will authenticate nodes. Prevents rouge nodes from joining the cluster -->
<SSL_KEY_EXCHANGE keystore_name="/opt/jboss/rundir-safe/ha.keystore"
keystore_password="${env.KEYSTORE_SECRET}"
session_verifier_class="org.jgroups.protocols.CertficateCNMatcher"
session_verifier_arg="CN=access-mgmt"
port="2157"
ssl_protocol="TLSv1.2"
stack.combine="INSERT_AFTER"
stack.position="VERIFY_SUSPECT"/>
<ASYM_ENCRYPT asym_keylength="2048"
change_key_on_leave="true"
change_key_on_coord_leave="true"
use_external_key_exchange="true"
sym_keylength="128"
sym_algorithm="AES"
asym_algorithm="RSA"
stack.combine="INSERT_AFTER"
stack.position="SSL_KEY_EXCHANGE"/>
<pbcast.GMS max_join_attempts="5"
join_timeout="10000"
stack.combine="REPLACE"
stack.position="pbcast.GMS"/>
</stack>
</jgroups>
<cache-container name="keycloak">
<transport stack="encrypt-tcp"
lock-timeout="60000"
cluster="ADP-IAM"/>
<local-cache name="realms">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<local-cache name="users">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<local-cache name="authorization">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<memory max-count="10000"/>
</local-cache>
<local-cache name="keys">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<expiration max-idle="3600000"/>
<memory max-count="1000"/>
</local-cache>
<replicated-cache name="work">
<expiration lifespan="-1"/>
</replicated-cache>
<distributed-cache name="sessions" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="authenticationSessions" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="offlineSessions" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="clientSessions" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="offlineClientSessions" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="loginFailures" owners="${env.CACHE_OWNERS:2}">
<expiration lifespan="-1"/>
</distributed-cache>
<distributed-cache name="actionTokens" owners="${env.CACHE_OWNERS:2}">
<encoding>
<key media-type="application/x-java-object"/>
<value media-type="application/x-java-object"/>
</encoding>
<expiration max-idle="-1" lifespan="-1" interval="300000"/>
<memory max-count="-1"/>
</distributed-cache>
</cache-container>
</infinispan>
I am not setting --cache-stack as I am defining my own stack. Everything works fine but I get below error:
2022-09-13 11:27:06,570 ERROR [org.jgroups.JChannel] (keycloak-cache-init) JGRP000016: exception in channelConnected callback: java.lang.NullPointerException
Am I missing something?