21 lines
1 KiB
Text
Executable file
21 lines
1 KiB
Text
Executable file
=== Replication and Failover
|
|
|
|
The +sessions+, +offlineSessions+ and +loginFailures+ caches are distributed caches which means that one more nodes
|
|
is designated as the owner of a specific cache entry. If a node is not the owner of a specific cache entry it queries
|
|
the cluster to obtain it. What this means for failover is that if the nodes that own a piece of data go down, that data
|
|
is lost forever. By default, {{book.project.name}} only specifies one owner for data. So if that one node goes down
|
|
that data is lost. This usually means that users will be logged out and will have to login again.
|
|
|
|
You can change the number of nodes that replicate a piece of data by change the +owners+ attribute in the +distributed-cache+ declaration
|
|
|
|
.owners
|
|
[source,xml]
|
|
----
|
|
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
|
|
<cache-container name="keycloak" jndi-name="infinispan/Keycloak">
|
|
<distributed-cache name="sessions" mode="SYNC" owners="2"/>
|
|
...
|
|
----
|
|
|
|
Here's we've changed it so at least two nodes will replicate one specific user login session.
|
|
|