0

If we scale up (add an instance to ELB), could we redirect some existing requests to the new instance. So that, The users that we force to a new server will be asked to login again

If we scale down (remove an instance from ELB), then all users from that server will automatically be redirected by ELB to other remaining servers. These user should not be aked to login again.

Is this possible (including the redirect of request)? How?

Any ideas are welcome but I presume this can be solved using a central session store. I just don't know how to implement it .

And what are the options in using a central session store? simpledb? redis? memcached?

Our application is just a simple web application hosted in apache. We have two instances of it added unto the Amazon ELB, and we are using PHP.

Any ELB php specific suggestions? when a scale down/up happens that no user-visible symptomps should be shown?

4

2 回答 2

1

在大多数情况下,这对您的最终用户应该是完全透明的,您无需进行太多更改。

您需要考虑的最大方面是通过添加/删除实例来确保会话保持/可用。

您可以通过在客户端上设置 cookie 来做到这一点(默认行为session_start()并确保所有使用 PHP 的 Web 服务器都可以获取有关会话 id 的信息。

有些人会使用 memcached 来做到这一点……而且 PHP 中有本地集成,可以将会话存储在 memcached 中……

于 2011-07-13T07:47:04.310 回答
1

有很多方法可以进行集中式会话管理。下面列出了其中一些:

D B:

http://ocklin.org/session_management_cluster.html

内存缓存:

  1. http://www.migrate2cloud.com/blog/how-to-configure-memcached-on-aws-ec2-a-starters-guide(确保主机能够毫无问题地连接),
  2. http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/
  3. http://php.net/manual/en/memcached.sessions.php

会议:

http://in.php.net/manual/en/ref.msession.php

于 2011-07-14T05:07:07.887 回答