Wildfly 9: JGRP000012: discarded message from different cluster hq-cluster (我们的集群是ee)

Wildfly 9: JGRP000012: discarded message from different cluster hq-cluster (our cluster is ee)

我们从 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 没有。我们使用 TCP 作为传输,但是根据 other resources UDP 也是如此。

有人有解决方案吗(当然除了提高日志的严重级别之外)?谢谢

我们终于找到了问题和解决方案。 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-stack,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的经验,但我认为原理是一样的。