# Gitea with redis cluster

**URL:** <https://forum.gitea.com/t/gitea-with-redis-cluster/8934>\
**Category:** Install/Maintain/Configure\
**Created:** [April 6, 2024, 7:09am UTC](https://forum.gitea.com/t/gitea-with-redis-cluster/8934 "2024-04-06T07:09:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thilak](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@thilak](https://forum.gitea.com/u/thilak)\
**Post date:** [April 6, 2024, 7:09am UTC](https://forum.gitea.com/t/gitea-with-redis-cluster/8934/1 "2024-04-06T07:09:01Z")

</div>

Hi ,

I am setting up a gitea deployment in k8s environment. For session and cache I am using a external redis cluster .

The redis cluster is configured as a stateful set and has a headless service created to access it.

The connection uri for redis from gitea is configured as below ,

_redis://user:@my-cluster:6379?pool\_size=100&idle\_timeout=180s_

The settings work properly when the redis cluster is configured with single node.

When more than 1 node is configured , I am getting “500 Internal Server” error during login.

**Logs from gitea pod**

2024/04/06 07:01:13 …eb/routing/logger.go:102:func1() [I] router: completed GET / for 192.168.253.139:53576, 200 OK in 3.8ms @ web/home.go:32(web.Home)  
2024/04/06 07:01:15 …eb/routing/logger.go:102:func1() [I] router: completed GET /user/login?redirect\_to=%2f for 192.168.253.139:53576, 200 OK in 11.7ms @ auth/auth.go:141(auth.SignIn)  
2024/04/06 07:01:17 …ers/web/auth/auth.go:312:handleSignInFull() [E] RegenerateSession: regenerate session: MOVED 8633 192.168.135.132:6379  
2024/04/06 07:01:17 …eb/routing/logger.go:102:func1() [I] router: completed POST /user/login for 192.168.253.139:53576, 500 Internal Server Error in 66.4ms @ auth/auth.go:170(auth.SignInPost)

Is there any setting for redis cluster with multiple nodes.

---

<div class="post-metadata">

**Author:** ![p7k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/p7k/32/4234_2.png) [@p7k](https://forum.gitea.com/u/p7k)\
**Post date:** [April 7, 2024, 7:32am UTC](https://forum.gitea.com/t/gitea-with-redis-cluster/8934/2 "2024-04-07T07:32:44Z")

</div>

With regard to [Config Cheat Sheet | Gitea Documentation](https://docs.gitea.com/administration/config-cheat-sheet), you have to change the connection string slightly for a multi-node Redis cluster to

```auto
redis+cluster://123@127.0.0.1:6379/0

```

Note especially the `redis+cluster`. Does that help?

---

<div class="post-metadata">

**Author:** ![thilak](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@thilak](https://forum.gitea.com/u/thilak)\
**Post date:** [April 7, 2024, 9:59am UTC](https://forum.gitea.com/t/gitea-with-redis-cluster/8934/3 "2024-04-07T09:59:52Z")

</div>

Actually I am trying to connect the redis instance via the headless service. Hence I am using only “redis” in the connection string.

But I also tried using redis+cluster in the connection string and there was no communication between gitea and redis cluster in that case.
