简体   繁体   English

具有自动缩放属性的EC2实例上tomcat的Memcahed会话管理器

[英]Memcahed session manager for tomcat on EC2 instances with autoscaling property

Assuming that I have two tomcats running on two EC2 instances and I have two memcached nodes running two different EC2 instances. 假设我有两个在两个EC2实例上运行的tomcat,并且我有两个在两个不同的EC2实例上运行的内存缓存节点。 And the EC2 instances on which tomcats are running, are behind one load balancer. 运行tomcat的EC2实例位于一个负载均衡器之后。 I have enabled sticky session functionality. 我启用了粘性会话功能。 And assuming that I have implemented auto-scaling property. 并假设我已经实现了自动缩放属性。 So whenever a new instance comes up with tomcat installed, do I need to change its tomcat's context.xml in order to configure tomcat's session manager for registering to memcached nodes? 因此,只要安装了tomcat的新实例出现了,我是否需要更改其tomcat的context.xml以便配置tomcat的会话管理器以注册到memcached节点?

Memcached servers have no knowledge of 'clients'. Memcached服务器不了解“客户端”。 They don't even know about other memcached servers. 他们甚至不了解其他内存缓存服务器。 Memcached clients have a configuration for a pool and perform a simple hash algorithm to determine which server to talk to. Memcached客户端具有池的配置,并执行简单的哈希算法来确定与哪个服务器通信。 The only dependency is that all your clients have the same configuration. 唯一的依赖性是所有客户端都具有相同的配置。 And you need to change tomcat's context.xml only if instances running memcached services change. 而且,仅当运行memcached服务的实例发生更改时,才需要更改tomcat的context.xml。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM