我有一个jboss集群有2个节点(a和b)+ 1个apache用作mod_cluster(apache在一个单独的服务器中)
如果其中一个节点A发生故障,则mod集群无法连接到另一个节点。
因此,如果nodeA崩溃,我无法通过http://apache_server/myapp访问jboss应用程序,但我可以通过http://nodeb/myapp反之亦然
我在google上挖掘几乎所有我发现的与会话有关的说法但是我不能说我的配置是wron。 (使用此工具配置的Mod_cluster Load Balancer Configuration Tool
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
答案 0 :(得分:1)
需要在domain.xml中进行的更改:
1.在<域控制器>,添加< remote host =“< ip-address-of-master-node>” port =“< port>”安全领域= “ManagementRealm”/>
2.在<服务器>,添加< server name =“slave-node”group =“server-group”auto-start =“true”>
3.在mod-cluster子系统下,添加< mod-cluster-config advertise-socket =“modcluster”proxy-list =“< ip-address>:< port-in-mod-cluster-config”connector =“ajp”>
在mod-cluster配置中:
1.允许所有人
2. ManagerBalancerName服务器组(上面的确切名称)
另外,您使用的是虚拟化/容器吗?要在这种情况下处理会话复制问题,您可能需要尝试“粘性会话”。
答案 1 :(得分:1)
mod_cluster,即modcluster子系统与上述任何内容无关。子系统完全忽略了这样一个事实,即形成了一些集群或者您在域中拥有了您的实例 - 这与首先在集群中拥有实例无关。在研究mod_cluster配置时,不要打扰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应用程序,即您的客户端丢失了他的上下文,例如购物车(流行展示)。
我不清楚为什么你需要改变它。如果更改默认值,则还必须更改Jboss modcluster子系统配置中的balancer="new_value"
。它的实际作用是告诉Apache HTTP Server中的mod_cluster在内部创建更多单独的命名ProxyPass Balacner。然后可以使用ProxyPass指令单独调整它们。你需要调整它们吗?根据配置的其余部分,我确信情况并非如此。例如,会话粘性在mod_cluster子系统中的JBoss节点中配置 - worker ndoes report this to Apache HTTP Server balancer。
HTH,-K -