Jelastic Traffic Distributor 100-0 余额,Sticky Sessions 失败?

Jelastic Traffic Distributor 100-0 balance, Sticky Sessions fail?

所以,下一个 Jelastic 问题!

我暂时无法使用 Spring Webflow,因此在任何负载平衡场景中的粘性会话都很重要。

我正在尝试使用 Jelastic Traffic Distributor 来实现 Blue/Green 部署。

我设置了两台服务器和它们前面的TD。我已经平衡了 TD 100-0 以支持服务器 1,并将路由方法设置为粘性会话。

此设置似乎运行良好,所有请求都发送到服务器 1 并在那里维护会话。事实上,粘性会话确保如果我将余额移动到 50-50,已经创建的会话会粘在服务器 1 上。

我希望通过将新代码部署到服务器 2 来实现蓝绿部署,同时 TD 仍设置为 100-0 平衡以支持服务器 1。部署代码后,我会将平衡移动到0-100 有利于服务器 2。旧会话将继续 运行 直到它们在服务器 1 中完成(即停留在卡住的地方),而新会话将被创建并卡在服务器 2 运行宁新代码。为以后的部署反向重复。

documentation here 暗示这个策略应该有效,尤其是最后一行;

Also, upon setting 100% ratio for any server, the second one won’t be removed from the settings completely, so it will be able to process the already existing sessions

然而,我看到的是,一旦我将余额移动到 0-100,之前卡在服务器 1 上的会话就会丢失,所有 请求都会平衡到服务器 2.

换句话说,文档的最后一行似乎不是真的?

我们的文档中有不正确的信息:

Also, upon setting 100% ratio for any server, the second one won’t be removed from the settings completely, so it will be able to process the already existing sessions.

我们的技术作者从文档中删除了这一行。

无法使用 weight=0 配置 NGINX,NGINX 将不会使用此参数值启动,因此这是预期的行为。当您在 UI 面板中设置权重 0 时 - 后端服务器被排除在 NGINX 配置之外,所有请求都被定向到保留在 nginx 上游的后端。

还有另一种解决方案,您可以使用 UI 设置权重比 99:1(或者例如 10000:1 使用 nginx-jelastic.conf 在 Traffic Distributor 中) .在这种情况下,会话丢失的可能性很小。