Running Redis as an external cache server for Redmine

12/10/2019

I have 2 pods of Redmine deployed with Kubernetes the problem due to this the issue of session management is happening so some users are unable to login due to this so I came up with the idea to store the cache of both the pods in Redis server with Kubernetes(Centralized).
I am giving the below configuration inside the Redmine pod in location. /opt/bitnami/redmine/config/application.rb

configuration

config.cache_store = :redis_store, {
  host: "redis-headless.redis-namespace",  #service name of redis 
  port: 6379,
  db: 0,
  password: "xyz",
  namespace: "redis-namespace"
}, {
  expires_in: 90.minutes
}

But this is not working as supposed .Need help where I am doing wrong.

-- user12417145
kubernetes
redis
redmine
ruby

1 Answer

12/11/2019

Redmine doesn't store any session data in its cache. Thus, configuring your two Redmines to use the same cache won't help.

By default Redmine stores the user sessions in a signed cookie sent to the user's browser without any server-local session storage. Since the session cookie is signed with a private key, you need to make sure that all installations using the same sessions also use the same application secret (and code and database).

Depending on how you have setup your Redmine, this secret is typically either stored in config/initializers/secret_token.rb or config/secrets.yml (relative to your Redmine installation directory). Make sure that you use the same secret here on both your Redmines.

-- Holger Just
Source: StackOverflow