ColdFusion 和云集群负载平衡会话
所以我正在尝试将我的应用程序移动到云中,特别是我使用 RackSpace,到目前为止一切都很好,将所有内容都指向 X 并发现负载均衡器不通过 https 提供粘性会话。
进一步搜索似乎亚马逊也没有这样做。
显然,我需要在服务器上维护用户或以某种方式跨实例共享会话数据。
我考虑过对您登陆的服务器进行硬重定向,但这会很糟糕,因为如果加了书签,用户将留在该服务器上。
任何建议。
So i'm trying to move my application to the cloud, specifically im using RackSpace and so far so good, got everything to point X and find that the load balancer doesn't offer stick sessions via https.
Searching further it seems that Amazon doesn't do this either.
Clearly I need to either maintain a user on a server or somehow share session data across instances.
I considered doing a hard redirect to the server you land on, however that would be bad as if bookmarked the user will stay on that server.
Any suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用客户端变量,而不是会话变量。不同之处在于客户端变量必须是简单的名称=值对,而且它们也可以具有适合您的请求的不同存储位置。根据您的需要,您可以选择通过“cookie 存储”将值存储在浏览器中或数据库中。您可以选择客户端变量在 Coldfusion Administrator 中的存储方式。这些选项中的任何一个都会将存储从特定应用程序服务器实例中转移出来,这正是简单集群所需的。如果您不太关心特定值的安全性,请选择基于 cookie 的;如果这是一个问题,请选择数据库。显然,如果您选择数据库,则需要将所有应用程序服务器配置为指向同一数据库。
编辑
我没有意识到您正在谈论现有的应用程序。是的,这肯定会是一个问题。在这种情况下,您需要做的就是配置负载均衡器,将给定的 CFID 和 CFToken(从 cookie 中读取)与集群中的特定节点关联起来。这样,“粘性”对最终用户来说是透明的,并且只会持续与会话一样长的时间。
编辑
再次,根据您的评论 - 由于您拥有企业版,因此您可以使用该版本提供的内置集群。这是一篇讨论该功能的文章 - http://www.adobe.com/devnet/ Coldfusion/articles/clustering_cf8.html
向下滚动一点,直到到达“Clustering and ColdFusion”部分 - 其中包含有关它的详细信息。
You could use client variables, rather than session variables. The difference is client variables have to be simple name=value pairs, but also they can have different storage locations that may suit your request. Depending on your need, you could choose to store the values within the browser, via "cookie storage", or within the database. You can choose how client variables are stored in coldfusion administrator. Either one of these options shifts the storage off of the particular application server instance, which is what you need for simple clustering. Choose cookie-based if you don't care much about the security of the particular values; choose database if that is a concern. Obviously, if you choose database, you'll need to configure all app servers to point at the same database.
edit
I didn't realize you were talking about an existing app. Yeah, that would certainly be a problem. In that case, what you would need to do is configure your load balancer to associate a given CFID and CFToken (read from the cookies) with a particular node in your cluster. This way the "stickiness" is transparent to the end user, and will only last as long as the session.
edit
Yet again, based on your comments - since you have the Enterprise edition, you could use the built-in clustering provided by that version. Here's an article discussing that feature - http://www.adobe.com/devnet/coldfusion/articles/clustering_cf8.html
Scroll down a bit until you get to the "Clustering and ColdFusion" section - that has good information on it.