我有一个jboss集群,有2个节点(a和b)1个apache用作mod_cluster(apache在一个单独的服务器中)
如果其中一个节点A发生故障,则mod集群无法连接到另一个节点.
所以,如果nodeA崩溃,我无法通过http://apache_server/myapp访问jboss应用程序,但我可以在http://nodeb/myapp之前,反之亦然
我挖谷歌几乎所有我发现说与会话有关,但我不知道什么是wron与我的配置. (使用此工具Load Balancer Configuration Tool配置的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
最佳答案 能见度
> JBoss工作者实例必须能够联系你的“`EnableMCPMReceive“ VirtualHost
>您的JBoss工作者实例将其IP地址和AJP端口报告给Apache HTTP Server
>您的Apache HTTP Server必须能够在这些报告的地址上与他们联系
的ProxyPass
JGroups,Infinispan,域名,集群
mod_cluster,即modcluster子系统与上述任何内容无关.子系统完全忽略了这样一个事实,即形成了一些集群或者您在域中拥有了您的实例 – 这与首先在集群中拥有实例无关.在研究mod_cluster配置时,不要打扰JGroups消息.
虽然,如果你的JGroups集群坏了……
Infinispan(即在这种情况下,您的Web会话数据的分布式或复制缓存)依赖于JGroups来形成集群并在此集群中交换消息.如果您的实例无法用于群集或无法交换消息,则可能会在故障转移时丢失会话数据.
例如:Apache HTTP Server 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指令:
>对来自特殊网络应用程序的特殊错误代码做出反应,例如:将应该表示错误的HTTP代码视为有效,反之亦然
>直接从Apache HTTP Server提供静态内容,而不是从工作节点提供静态内容 – 例如图片…
>将一些上下文负载平衡到mod_cluster感知的JBoss工作者节点和一些上下文到非mod_cluster服务器,例如另一个在PHP中运行Drupal的Apache HTTP Server …
ManagerBalancerName
我不清楚为什么你需要改变它.如果更改默认值,则还必须在Jboss modcluster子系统配置中更改balancer =“new_value”.它的实际作用是告诉Apache HTTP Server中的mod_cluster在内部创建更多单独的命名ProxyPass Balacner.然后可以使用ProxyPass指令单独调整它们.你需要调整它们吗?根据配置的其余部分,我确信情况并非如此.例如,会话粘性在mod_cluster子系统中的JBoss节点中配置 – 工作者ndoes将此报告给Apache HTTP Server平衡器.
HTH,-K-