Keycloak bare metal quarkus and cluster ha - distributed cache not working

Hi @weltonrodrigo and @dasniko , thanks so much for your help.

Yes, I have the cache-ispn-ha.xml in the conf directory. The application read oks this configuration.
I have remove the cache-stack=tcp of my code too.

Final code snippet in keycloak.conf is:

cache=ispn
cache-config-file=cache-ispn-ha.xml

The problem is in the discovery of the nodes.
I have this snippet in cache config file because I would like simply ping connection for discovery nodes.

<jgroups>
    <stack name="tcpping" extends="tcp">
        <TCP     bind_port="7800" />
        <TCPPING initial_hosts="redhattest1[7800],redhattest2[7800]" port_range="0" max_dynamic_hosts="2"/>
    </stack>
</jgroups>

<cache-container name="keycloak">
    <transport cluster="mykeycloak" lock-timeout="60000"  stack="tcpping" node-name="redhattestttt1"/>
    <local-cache name="realms">

Tested too with internal ip address.
It should work but not, when I launch 2 keycloak instances appear 2 nodes as a coordinator (not ok).

I think perhaps the problem is use Azure virtual machines.
I have firewalld enabled for this ports for 2 servers and enabled rule AllowVnetInBound enabled in networks for each virtual machine in Azure Portal.

[redhat@redhattest1 ~]$ sudo firewall-cmd --zone=public --permanent --list-ports
80/tcp 443/tcp 7800/tcp 7800/udp

I want to define this custom tcp solution (or similar) for discovery (no azure solution with AZURE_PING) because this is a POC in Azure but I want to install Keycloak quarkus in a Bare metal corporate infraestructure.

It would have to be possible but maybe I’ll try the solution with AZURE_PING and I already left the horns on the baremetal machine when I play and I assume that the ping problem was because it was azure :wink:

I think the documentation of new Keycloak Quarkus (Guides - Keycloak) is simply and clair but insufficient on this documentation for use cases as common as tcpping on “normal” unix servers (not azure, ec, google).

Any idea? :wink:

Thanks for your help.

Xavier.