在TCP配置Amazon弹性负载均衡Socket.io的WebSockets [英] Socket.io Websockets on a TCP configured Amazon Elastic Load Balancer

查看:901
本文介绍了在TCP配置Amazon弹性负载均衡Socket.io的WebSockets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算成立一个小组NodeJS应用服务器运行在EC2上 Socket.io 和我倒要使用href="http://aws.amazon.com/elasticloadbalancing/" rel="nofollow">弹性负载均衡它们之间采用S $ P $垫负荷这里的情景2 。

I'm planning to set up a group of NodeJS application servers running Socket.io on EC2, and I'd like to use the Elastic Load Balancer to spread load between them. I know ELB doesn't support Websockets out of the box, but I can use the setup described here in Scenario 2.

作为<一个描述href="http://johan.heapsource.com/post/31047804966/the-state-of-websockets-ssl-and-sticky-sessions-in"相对=nofollow>博客文章的,不过,我注意到,这个设置不提供会话亲和源IP信息:

As described in the blog post, though, I notice that this setup offers no session affinity or source IP info:

我们不能有会话关联性,也没有的X转发头在此设置   因为ELB未解析HTTP消息,所以它不可能   搭配饼干,以确保会议亲和力也注入特殊   的X转发头。

We can not have Session Affinity nor X-Forward headers with this setup because ELB is not parsing the HTTP messages, so its impossible to match the cookies to ensure Session Affinity nor Inject special X-Forward headers.

请问Socket.io仍然在这种情况下工作?或者是有另一种方式让身后SSL负载平衡器?

Will Socket.io still work under these circumstances? Or is there another way to have a set of Socket.io app servers behind a load balancer with SSL?

编辑:蒂姆·卡斯韦尔谈到这样做了 rel="nofollow">。是否有任何职位解释如何设置呢?同样没有会话粘性这里,但事情似乎是工作的罚款。

Tim Caswell talks about doing this already here. Are there any posts explaining how to set this up? Again there's no session stickiness here, but things seem to be working fine.

顺便说一句,有粘性会话实际需要使用WebSockets?请问旅游信息作为新的独立的请求,还是有只有一个要求+连接,所有的信息一起移动?

As an aside, are sticky sessions actually necessary with websockets? Does information travel as new and separate requests or is there only one request + connection that all the information moves along?

推荐答案

正如我在帖子中提到,我们只用ELB到SSL终止和整个的HTTP代理服务器都支持WebSockets的集群负载均衡。 ELB不说话,直接WebSocket的服务器。 HTTP代理集群处理仰视的权利socket.io服务器连接到确保会议粘性。

As I mentioned in the post, we only use ELB to ssl terminate and load-balance across a cluster of http-proxy servers that do support websockets. ELB doesn't talk to the websocket servers directly. The HTTP proxy cluster handles looking up the right socket.io server to connect to ensuring session stickiness.

这篇关于在TCP配置Amazon弹性负载均衡Socket.io的WebSockets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆