ivangfr / keycloak-clustered

Keycloak-Clustered extends quay.io/keycloak/keycloak official Keycloak Docker image by adding JDBC_PING discovery protocol.
167 stars 57 forks source link

Unable to start keycloak on 2nd boot #1

Closed petrtuma closed 4 years ago

petrtuma commented 4 years ago

Hi there,

on 2nd boot dwildfly stuck on line: Setting JGroups discovery to TCPPING with properties {initial_hosts=>"192.168.0.138[7600],192.168.0.139[7600]"} and dorker container is exited(1).

The problem is: TCPPING.cli skript failes and any logs is printed to the output.

I Solved this issue by edit TCPPING.cli like this:

embed-server --server-config=standalone-ha.xml --std-out=echo
batch
  /subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:2})
  /subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:2})
  /subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:2})
  /subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:write-attribute(name=owners, value=${env.CACHE_OWNERS:2})
run-batch

try
  /subsystem=jgroups/stack=udp:remove()
  /subsystem=jgroups/stack=tcp/protocol=MPING:remove()
catch
end-try

try
  /subsystem=jgroups/stack=tcp/protocol=$keycloak_jgroups_discovery_protocol:remove()
catch
finally
  /subsystem=jgroups/stack=tcp/protocol=$keycloak_jgroups_discovery_protocol:add(add-index=0, properties=$keycloak_jgroups_discovery_protocol_properties)
  /subsystem=jgroups/channel=ee:write-attribute(name=stack, value="tcp")

  /subsystem=jgroups/stack=tcp/transport=TCP/property=external_addr/:add(value=${env.JGROUPS_DISCOVERY_EXTERNAL_IP:127.0.0.1})
end-try
stop-embedded-server
ivangfr commented 4 years ago

Hi @petrtuma thanks for sharing. Whenever I have time, I will try and implement your solution.