【问题标题】:Keycloak: Cluster mode distributed session owners not workingKeycloak:集群模式分布式会话所有者不工作
【发布时间】:2022-01-11 03:59:36
【问题描述】:
我们在 Docker 上以集群的形式运行 keycloak 部署,最近遇到的问题是,如果一个节点出现故障,则该特定节点的关联会话会被注销。根据 Keycloak 的文档,它提到了
<subsystem xmlns="urn:jboss:domain:infinispan:12.0">
<cache-container name="keycloak">
<distributed-cache name="sessions" owners="2"/>
应该解决这个问题,但它仍然不能解决问题,如果节点被删除,相关的会话就会被注销。
对此的任何帮助将不胜感激。
【问题讨论】:
标签:
docker
cluster-computing
keycloak
session-state
【解决方案1】:
查看以下设置
<cache-container name="keycloak">.
应该是这样的:
<replicated-cache name="work"/>
<distributed-cache name="sessions" owners="1"/>
<distributed-cache name="authenticationSessions" owners="1"/>
<distributed-cache name="offlineSessions" owners="1"/>
<distributed-cache name="clientSessions" owners="1"/>
<distributed-cache name="offlineClientSessions" owners="1"/>
<distributed-cache name="loginFailures" owners="1"/>
<distributed-cache name="actionTokens" owners="1">
确保“会话”没有被覆盖,并将“2”放在所有的“所有者”中。
重启keycloak。