代码之家  ›  专栏  ›  技术社区  ›  TomS

Wildfly 9:JGRP000012:来自不同集群hq集群的丢弃消息(我们的集群是ee)

  •  5
  • TomS  · 技术社区  · 10 年前

    在我们从Wildfly 8.2.1.Final升级到Wildfly 9.0.1.Final之后,我们开始收到如下警告:

    WARNING [org.jgroups.protocols.TCP] (INT-1,ee,dev6.example.com:server1) JGRP000012: discarded message from different cluster hq-cluster (our cluster is ee). Sender was ad3f8046-3c95-f6d4-da13-3019d931f9e4 (received 4 identical messages from ad3f8046-3c95-f6d4-da13-3019d931f9e4 in the last 64159 ms)
    

    这些消息针对不同的主机和主机上的服务器。另一方面,Wildfly的Beta版和CR版中也有同样的情况,但在版本8中没有 other resources UDP也是如此。

    是否有人有解决方案(当然不是提高日志的严重性级别)?谢谢

    1 回复  |  直到 10 年前
        1
  •  7
  •   TomS    10 年前

    我们终于找到了问题和解决方案。Wildfly 9在同一通信信道内为集群节点和HornetQ发送消息,这似乎会产生冲突。我们通过创建第二个堆栈并在它们之间划分流量来解决这个问题。

    对于TCP,工作配置如下:

            <stacks default="tcp">
                <stack name="tcp">
                    <transport type="TCP" socket-binding="jgroups-tcp"/>
                    <protocol type="TCPPING">
                         <property name="initial_hosts">
                             node1[7600],node1[7750],node2[7600],node2[7750]
                         </property>
                         <property name="port_range">
                             0
                         </property>
                    </protocol>
                    <protocol type="MERGE2"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                    <protocol type="FD"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                    <protocol type="RSVP"/>
                </stack>
                <stack name="tcphq">
                    <transport type="TCP" socket-binding="jgroups-tcp-hq"/>
                    <protocol type="TCPPING">
                        <property name="initial_hosts">
                            node1[7660],node1[7810],node2[7660],node2[7810]
                        </property>
                        <property name="port_range">
                            0
                        </property>
                    </protocol>
                    <protocol type="MERGE2"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-hq-fd"/>
                    <protocol type="FD"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                    <protocol type="RSVP"/>
                </stack>
            </stacks>
    

    您还需要配置HornetQ(使用适当的jgroups堆栈, tcphq 在这种情况下):

            <broadcast-groups>
                <broadcast-group name="bg-group1">
                     <jgroups-stack>tcphq</jgroups-stack>
                     <jgroups-channel>hq-cluster</jgroups-channel>
                     <broadcast-period>5000</broadcast-period>
                     <connector-ref>
                          http-connector
                     </connector-ref>
                </broadcast-group>
            </broadcast-groups>
    
            <discovery-groups>
                <discovery-group name="dg-group1">
                     <jgroups-stack>tcphq</jgroups-stack>
                     <jgroups-channel>hq-cluster</jgroups-channel>
                     <refresh-timeout>10000</refresh-timeout>
                </discovery-group>
            </discovery-groups>
    

    …当然,您需要添加相关 socket-binding 进入 socket-binding-group :

            <socket-binding name="jgroups-tcp-hq" port="7660"/>
            <socket-binding name="jgroups-tcp-hq-fd" port="7670"/>
    

    不幸的是,我没有UDP的经验,但我认为原理是一样的。

    推荐文章