简体   繁体   English

发现后mod_cluster无法平衡负载

[英]mod_cluster not balancing load after discover

I have cluster setup up and running ...Jboss 7.1.1.Final and mod_cluster mod_cluster-1.2.6.Final. 我已经建立并运行了集群... Jboss 7.1.1.Final和mod_cluster mod_cluster-1.2.6.Final。

mod_cluster load balancing is happening bitween two nodes - nodeA nodeB. mod_cluster负载平衡发生在两个节点之间-nodeA nodeB。

But when I stop one node and start, mod_cluster still sends the all load to the other node. 但是当我停止一个节点并启动时,mod_cluster仍将所有负载发送到另一节点。 It is not distributing load after comeback. 恢复后不会分配负载。

What is configuration changes required this ? 这需要什么配置更改? I could see both nodes enabled in mod_cluster_manager. 我可以看到在mod_cluster_manager中启用了两个节点。 But it directs load only to one node even after the other node comeback after fail over. 但是,即使故障转移后另一个节点恢复正常,它也仅将负载定向到一个节点。

Thanks 谢谢

If you are seeing existing requests being forwarded to the active node, then it's because of sticky session being enabled. 如果看到现有请求被转发到活动节点,则是因为启用了粘性会话。 This is the default behavior. 这是默认行为。

If you are seeing new requests are not being forwarded to the new node (even when it's not busy) then it is a different issue. 如果您看到新请求没有转发到新节点(即使它不忙),那就是另一个问题。 You may want to look at the load balancing factor/algorithm that you are currently utilizing in your mod-cluster subsystem. 您可能需要查看您当前在mod-cluster子系统中使用的负载平衡因子/算法。

It came to my mind, that you might actually be seeing the correct behaviour -- within a short time span. 我想到,您实际上可能会在短时间内看到正确的行为。 Take a look at my small FAQ: I started mod_cluster and it looks like it's using only one of the workers . 看一下我的小型FAQ: 我启动了mod_cluster,看起来好像只使用了一个worker

TL;DR: If you send only a relatively small amount of requests, it might look like the load balancing doesn't work whereas it's actually correct not to flood fresh newcomers with a barrage of requests at once. TL; DR:如果您仅发送相对少量的请求,则看起来负载平衡不起作用,而实际上不立即用大量请求淹没新来者是正确的。

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

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