我有一个jboss集群,它有两个节点(a和b) +1 apache作为mod_cluster (apache在一个单独的服务器中)
如果其中一个nodeA崩溃,mod集群将无法连接到另一个集群。
所以,如果nodeA崩溃了,我就不能通过服务器/myapp访问jboss应用程序,但是我可以通过http://nodeb/myapp访问jboss,反之亦然。
我喜欢谷歌,几乎所有我找到的都说这是与会话有关,但我无法确定什么是我的配置。(使用此工具配置的Mod_cluster 负载均衡器配置工具 )
NodeA日志
15/05/2016 07:45:22,741 ERROR [org.jgroups.protocols.TCP] (http-/nodeA:8080-90) failed sending message to jbossnodeb:jbossnodeb/web (4148 bytes): java.net.SocketException: Socket closed, cause: null
15/05/2016 07:45:22,790 ERROR [org.jgroups.protocols.TCP] (OOB-6464,shared=tcp) failed sending message to jbossnodeb:jbossnodeb/web (4141 bytes): java.net.SocketException: Broken pipe, cause: null
NodeB日志
15/05/2016 07:45:23,126 ERROR [org.jgroups.protocols.TCP] (OOB-4949,shared=tcp) failed sending message to jbossnodea:jbossnodea/web (79 bytes): java.net.SocketException: Broken pipe, cause: null
15/05/2016 07:45:53,457 WARN [org.jgroups.protocols.TCP] (Timer-1,shared=tcp) null: no physical address for jbossnodea:jbossnodea/web, dropping message
Apache mod_cluster服务器日志
[Sun May 15 07:45:04 2016] [error] (70007)The timeout specified has expired: proxy: read response failed from (null) (nodeA_IP)
[Sun May 15 07:45:34 2016] [error] (70007)The timeout specified has expired: ajp_cping_cpong: apr_socket_recv failed
[Sun May 15 07:45:38 2016] [error] ajp_handle_cping_cpong: ajp_ilink_receive failed
[Sun May 15 07:45:38 2016] [error] (70007)The timeout specified has expired: proxy: AJP: cping/cpong failed to (null) (nodeA_IP)
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: ajp_cping_cpong: apr_socket_recv failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:44 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] (70007)The timeout specified has expired: proxy: dialog to (null) (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] (70007)The timeout specified has expired: proxy: dialog to (null) (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] proxy: CLUSTER: (balancer://clusterjboss). All workers are in error state
配置apache mod_cluster
AdvertiseGroup 225.0.1.107:23364
KeepAliveTimeout 60
ManagerBalancerName clusterjboss
ServerAdvertise On
AdvertiseFrequency 5
EnableMCPMReceive
CreateBalancers 0
AllowDisplay On
ProxyPass / balancer://clusterjboss/ stickysession=JSESSIONID|jsessionid nofailover=On
发布于 2016-05-31 10:40:37
可见性
EnableMCPMReceive
VirtualHost‘JGroups,Infinispan,域,聚类
mod_cluster,即MOD集群子系统与上述任何事情都没有任何关系。子系统完全忽略了这样一个事实,即存在一些集群,或者您的实例在域中--这与首先将实例放在集群中也是无关的。在研究JGroups配置时,不要费心处理mod_cluster消息。
尽管,如果您的JGroups集群被破坏了.
Infinispan --即web会话数据的分布式或复制缓存--在这种情况下,它依赖于JGroups来形成集群并在这个集群中交换消息。如果您的实例不能用于群集或未能交换消息,则在故障转移时可能会丢失会话数据。
例如: Apache mod_cluster balacner决定使用JSESSIONID yadayadaXXX.worker-1向worker-2发送请求,因为worker-1已关闭。由于网络配置错误,worker-1和worker-2从未正确形成群集,因此worker-2没有worker-1的会话数据。其结果是创建了一个具有新会话的web应用程序,即您的客户端丢失了上下文,例如购物车(流行展示)。
ProxyPass
不要使用它,除非你有一些具体的想法。mod_cluster的全部要点是,它在内存中动态地创建所有代理指令,因为您的工作节点及其web应用程序来来去去。如果您想要使用其他ProxyPass指令,就可以开始修改:
ManagerBalancerName
我不清楚你为什么要改变它。如果您更改了默认值,您还必须在Jboss子系统配置中更改balancer="new_value"
。实际上,它告诉Apache中的mod_cluster在内部创建更独立的名为ProxyPass Balacner。然后,可以使用ProxyPass指令分别对它们进行调整。你需要调整它们吗?根据您配置的其余部分,我确信情况并非如此。例如,会话粘性是在JBoss子系统中的mod_cluster节点中配置的- worker ndoes将此报告给Apache平衡器。
HTH,-K-
发布于 2016-05-26 19:12:50
需要在domain.xml中进行的可能更改:
在mod集群配置中:
另外,您是否使用任何虚拟化/容器?为了在这种情况下处理会话复制问题,您可能需要尝试“粘性会话”。
https://stackoverflow.com/questions/37284974
复制相似问题