使用 ipvsadm LVS 进行 RabbitMQ 负载平衡和故障转移

发布于 2024-10-06 02:38:12 字数 360 浏览 0 评论 0原文

我们有一个平台,使用 2 个rabbitmq 节点,通过前面的 Linux LVS (ipvsadm) 进行负载平衡。我们为 ipvsadm 配置了持久连接和带有心跳的客户端。到目前为止,一切都很好。

部署后,我们通常有一半客户端连接到第一个节点,另一半连接到第二个节点。 我们尝试停止一个节点(rabbitmqctl stop_app 和 start_app)。客户端正在重新连接rabbitmq集群,LVS将连接发送到节点。因此所有客户端都连接到第二个节点。

我们有两个问题:

1)当第一个节点启动时,如何设法重新连接两个节点上的客户端(负载平衡)?

2)如果所有客户端都连接到一个节点会出现问题吗?

谢谢您的回答。

We have a plateform that uses 2 rabbitmq nodes loadbalanced by a linux LVS (ipvsadm) in front. We have ipvsadm configured with persistent connections and clients with heartbeat. So far so good.

After deployment, we generally have half of the clients connected to the first node and the other half connected to the second node.
We tried to stop one node (rabbitmqctl stop_app and start_app). The clients are reconnecting rabbitmq cluster, and the LVS sends the connections to the node up. So all the clients are connected to the second node.

We have 2 questions :

1) when the first node is up, how do you manage to reconnect the clients on the two nodes (loadbalancing) ?

2) is it a problem if all the clients are connected to one node ?

Thank you for your anwsers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文