首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Jboss Mod_cluster

Jboss Mod_cluster
EN

Stack Overflow用户
提问于 2016-05-17 19:43:40
回答 2查看 2K关注 0票数 4

我有一个jboss集群,它有两个节点(a和b) +1 apache作为mod_cluster (apache在一个单独的服务器中)

如果其中一个nodeA崩溃,mod集群将无法连接到另一个集群。

所以,如果nodeA崩溃了,我就不能通过服务器/myapp访问jboss应用程序,但是我可以通过http://nodeb/myapp访问jboss,反之亦然。

我喜欢谷歌,几乎所有我找到的都说这是与会话有关,但我无法确定什么是我的配置。(使用此工具配置的Mod_cluster 负载均衡器配置工具 )

NodeA日志

代码语言:javascript
运行
复制
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日志

代码语言:javascript
运行
复制
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服务器日志

代码语言:javascript
运行
复制
[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

代码语言:javascript
运行
复制
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
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-05-31 10:40:37

可见性

  • JBoss工作者实例必须能够联系您的`EnableMCPMReceive VirtualHost‘
  • 您的JBoss工作实例向报告其IP地址和AJP端口
  • 您的必须能够在报告的地址ProxyPass上与它们联系

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指令,就可以开始修改:

  • 对来自特定web应用程序的特殊错误代码作出反应,例如将HTTP代码视为有效的错误,反之亦然
  • 为了直接从而不是从工作节点提供静态内容,例如图片.
  • 为了将一些上下文负载到mod_ JBoss工作节点和一些上下文到非mod_集群服务器,例如另一个在PHP中运行Drupal的.

ManagerBalancerName

我不清楚你为什么要改变它。如果您更改了默认值,您还必须在Jboss子系统配置中更改balancer="new_value"。实际上,它告诉Apache中的mod_cluster在内部创建更独立的名为ProxyPass Balacner。然后,可以使用ProxyPass指令分别对它们进行调整。你需要调整它们吗?根据您配置的其余部分,我确信情况并非如此。例如,会话粘性是在JBoss子系统中的mod_cluster节点中配置的- worker ndoes将此报告给Apache平衡器。

HTH,-K-

票数 1
EN

Stack Overflow用户

发布于 2016-05-26 19:12:50

需要在domain.xml中进行的可能更改:

  1. 在<域-控制器>下,添加< host="< ip-主节点地址>“port="< port>”安全-领域=“ManagementRealm”/>。
  2. 在< servers>下,添加< server name=“从节点”group=“服务器组”“auto=”“>。
  3. 在mod-集群子系统下,添加:< port proxy config”connector=“”>“

在mod集群配置中:

  1. 人人都允许
  2. ManagerBalancerName服务器-组(确切名称如下所示)

另外,您是否使用任何虚拟化/容器?为了在这种情况下处理会话复制问题,您可能需要尝试“粘性会话”。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37284974

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档