本文介绍了轨道,设计,英雄和多个动力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在Heroku上运行的应用程序,它有多个dynos。让我们说应用程序有2个dynos,当用户登录时,他被第一个dyno服务。如果由于某种原因,后续请求由第二个dyno提供,他似乎没有登录。



唯一的解决方法(从我们测试)似乎将会话存储设置为cookie存储。有没有人遇到这个问题?

解决方案

我想你可能没有正确配置其他会话存储。 p>

您是否将缓存服务连接到memcached或redis,所以每个dyno都会查找一个共享位置来查找会话信息?




We have an application running on Heroku, that has multiple dynos. Let's say the application has 2 dynos, and when the user logs in, he's being served by the first dyno. If for some reason, subsequent requests are served by the second dyno, he appears as not being logged in.

The only way to fix this ( from what we tested ) seems to be setting the session store to cookie store. Has anyone else encountered this problem before?

解决方案

I think you probably didn't have your other session store configured properly.

Did you have the cache service wired in like memcached or redis, so each dyno would look to a shared location for finding session info?

Heroku memcache from Ruby

这篇关于轨道,设计,英雄和多个动力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:18