Closed gunterze closed 2 years ago
Hi @gunterze
About deploying both Keycloak instances on the same docker host, I also didn't get why both instances have the same bind_addr
in JGROUPSPING
tables. But, it works in the end, i.e, the cluster is formed. That is the most important thing.
About deploying the instance on different docker hosts, I tried to reproduce it using the Vagrant environment (Virtualbox) as described in the README - Running a Keycloak Cluster using JDBC_PING in Virtual Machines
In fact, I successfully got a Keycloak cluster running, even having MariaDB, Keycloak1 and Keycloak2 on completely different machines.
Just forgot to export the JGroups TCP port (default: 7800). Made the port configurable by an ENV in my cache configuration file:
<TCP external_addr="${env.JGROUPS_DISCOVERY_EXTERNAL_IP:127.0.0.1}" bind_addr="${env.JGROUPS_BIND_IP}" bind_port="${env.JGROUPS_TCP_PORT:7800}" />
Enabling to specify also the bind addr was needed for deploying on Docker Swarm...
No sharing on deploying second Keycloak instance on different docker host, connecting to same DB instance:
E.g.: on
node1
:On
node2
:Select entries in JGROUPSPING table:
returns only 1 record. The record inserted by first started instance got replaced by the record inserted by the second instance started after.
A may be (un-)related observation: Deploying both keycloak instances on the same docker host as described by https://github.com/ivangfr/keycloak-clustered#readme selects 2 records:
with equal
bind_addr
(=that of the first started keycloak instance) !?