Wildfly 10:使用负载平衡的Wildfly服务器不响应请求

时间:2016-12-13 09:18:58

标签: wildfly load-balancing wildfly-10

每当我向任何一台服务器发出请求时,它都没有响应,客户端正在等待它的响应。

我在群集中配置了两个WildFly实例。我正在使用Standalone-full-ha.xml

Standalone-full-ha.xml相关配置

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
    <buffer-cache name="default" />
    <server name="default-server">
        <ajp-listener name="ajp" socket-binding="ajp" />
        <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" />
        <http-listener name="management" socket-binding="mcmp-management" enable-http2="true" />
        <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true" />
        <host name="default-host" alias="localhost">
            <filter-ref name="load-balancer" />
        </host>
    </server>
    <servlet-container name="default">
        <jsp-config/>
        <websockets/>
    </servlet-container>
    <handlers>
        <file name="welcome-content" path="${jboss.home.dir}/welcome-content" />
    </handlers>
    <filters>
        <mod-cluster name="load-balancer" management-socket-binding="mcmp-management" advertise-socket-binding="modcluster" enable-http2="true" />
    </filters>
</subsystem>
<subsystem xmlns="urn:jboss:domain:modcluster:2.0">
    <mod-cluster-config advertise-socket="modcluster" connector="ajp">
        <dynamic-load-provider>
            <load-metric type="requests" />
        </dynamic-load-provider>
    </mod-cluster-config>
</subsystem>

<interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:0.0.0.0}" />
    </interface>
    <interface name="public">
        <inet-address value="${jboss.bind.address:0.0.0.0}" />
    </interface>
    <interface name="private">
        <inet-address value="${jboss.bind.address.private:0.0.0.0}" />
    </interface>
    <interface name="unsecure">
        <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}" />
    </interface>
    <interface name="jgroups-interface">
        <inet-address value="${jboss.bind.address.unsecure:XXX.XXX.XXX.XXX}" />
    </interface>
</interfaces>

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9950}" />
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9953}" />
    <socket-binding name="ajp" port="${jboss.ajp.port:8019}" />
    <socket-binding name="http" port="${jboss.http.port:8580}" />
    <socket-binding name="https" port="${jboss.https.port:8445}" />
    <socket-binding name="iiop" interface="unsecure" port="3538" />
    <socket-binding name="iiop-ssl" interface="unsecure" port="3539" />
    <socket-binding name="jgroups-mping" interface="jgroups-interface" port="0" multicast-address="${jboss.default.multicast.address:230.5.0.4}" multicast-port="45750" />
    <socket-binding name="jgroups-tcp" interface="jgroups-interface" port="7650" />
    <socket-binding name="jgroups-tcp-fd" interface="jgroups-interface" port="57650" />
    <socket-binding name="jgroups-udp" interface="jgroups-interface" port="55200" multicast-address="${jboss.default.multicast.address:230.5.0.4}" multicast-port="45658" />
    <socket-binding name="jgroups-udp-fd" interface="jgroups-interface" port="54250" />
    <socket-binding name="modcluster" multicast-address="224.0.5.105" multicast-port="23354" />
    <socket-binding name="txn-recovery-environment" port="4752" />
    <socket-binding name="txn-status-manager" port="4753" />
    <socket-binding name="messaging" port="5485" />
    <socket-binding name="messaging-throughput" port="5495" />
    <socket-binding name="mcmp-management" interface="jgroups-interface" port="${jboss.mcmp.port:8060}" />
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25" />
    </outbound-socket-binding>
</socket-binding-group>

这两种服务器上的配置相同。当我启动两台服务器时,我可以看到以下日志:

13:08:54,528 INFO  [org.infinispan.CLUSTER] (remote-thread--p6-t1) ISPN000310: Starting cluster-wide rebalance for cache routing, topology CacheTopology{id=2, rebalanceId=2, currentCH=ReplicatedConsistentHash{ns = 256, owners = (1)[app.node-01: 256]}, pendingCH=ReplicatedConsistentHash{ns = 256, owners = (2)[app.node-01: 133, app.node-02: 123]}, unionCH=null, actualMembers=[app.node-01, app.node-02]}
13:08:54,529 INFO  [org.infinispan.CLUSTER] (remote-thread--p6-t2) ISPN000310: Starting cluster-wide rebalance for cache APP.war, topology CacheTopology{id=2, rebalanceId=2, currentCH=DefaultConsistentHash{ns=256, owners = (1)[app.node-01: 256+0]}, pendingCH=DefaultConsistentHash{ns=256, owners = (2)[app.node-01: 133+123, app.node-02: 123+133]}, unionCH=null, actualMembers=[app.node-01, app.node-02]}
13:08:54,532 INFO  [org.infinispan.CLUSTER] (remote-thread--p6-t1) [Context=routing][Scope=app.node-01]ISPN100002: Started local rebalance
13:08:54,532 INFO  [org.infinispan.CLUSTER] (remote-thread--p6-t2) [Context=APP.war][Scope=app.node-01]ISPN100002: Started local rebalance

我还尝试将网址粘贴到浏览器http://<ip>:<Port>/App中,而不是显示欢迎页面。浏览器也没有显示任何内容并且卡在那里:显示一个旋转圆圈,通常可以在不完整加载时看到。

0 个答案:

没有答案