Docker image always reset its session on restart

544 views
Skip to first unread message

Satoshi SUZUKI

unread,
Feb 23, 2021, 3:29:26 AM2/23/21
to Keycloak User
Hi, there

I'm planning to use Keycloak on production, reading these articles:

In my test environment, it launches Keycloak & Postgres with docker-compose. It works.
It seems to persist realms and users to Postgres DB.
But, once I restart the docker process, it would clear sessions.
I suspect I have to configure or persist the realm's salt or key or secret or something.

Anyone knows about that ...?


Regards,

Satoshi Suzuki

Garth

unread,
Feb 23, 2021, 3:52:51 AM2/23/21
to Keycloak User
Sessions are not persisted to the database. They live in the cache (Infinispan). To have them survive restart, you either need to cluster or run Infinispan separately from Keycloak. See the docs for information on Keycloak clustering.
> --
> You received this message because you are subscribed to the Google
> Groups "Keycloak User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to keycloak-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/keycloak-user/778add81-4017-4ae4-8eb6-8912ee6e362dn%40googlegroups.com <https://groups.google.com/d/msgid/keycloak-user/778add81-4017-4ae4-8eb6-8912ee6e362dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Satoshi SUZUKI

unread,
Feb 23, 2021, 8:22:37 AM2/23/21
to Keycloak User
Hi Garth

Thanks a lot!
It completely answers my question! I will have a look at it!

2021年2月23日火曜日 17:52:51 UTC+9 Garth:
Reply all
Reply to author
Forward
0 new messages