繁体   English   中英

使用 infinispan 进行 http session 集群和缓存时经常出现 TimeoutException

[英]Often TimeoutException when using infinispan for http session clustering and caching

我有两台服务器需要做 http session 集群和缓存。 每台服务器都有多个节点需要共享session。但是在组建集群的过程中,经常会出现每台服务器无法获取对方服务器正确节点名的情况,并显示一组随机的字母和数字。就像这样:

2019-11-13 00:28:32,973 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] ISPN000094:收到新的集群视图:[12dshost10-14444|11] (12) [12dshost10-14444, 12dhost10-27717, b5f9d81c-046d-bbc5-7de0-0fe99cce2e53, ce824896-df27-fef0-5872-857335dd9ce0, aeec4fab-e57d-2e99-3e06-834c998ee897, b857e4c0-abe4-e989-bc4c-2ab05b60dc12, ca6a9e84-c9ca-3fad-lf20-787539477a2f, 12dshost11-28633、12dshost10-24663、12dshost10-3048、12dshost10-14948、12dshost10-47369]

在这种情况下,“ 12dshost10 ”代表本地服务器,所有节点名都正确,“ 12dshost11 ”代表远程服务器,其他异常节点名实际上来自12dshost11 。不知道为什么会变成这样。

在这种情况下,这个集群无法正常工作,在session缓存的过程中,这些异常节点总是在等待15秒后抛出TimeoutException,似乎无法与这些异常节点通信。 在这段时间内,我所有的请求也会被阻塞,直到抛出异常。 我阅读了infinispan的教程,但是没有找到使session缓存异步的方法,也找不到这些异常节点出现的原因。 有没有人有这样的问题?

这是我对 infinispan 和缓存的配置。

<infinispan>
<global>
   <transport>
       <properties>
            <property name="configurationFile" value="cache-web-session-jgroups.xml"/>
            <property name="channelLookup" value="com.wjw.aos.cache.impl.infinispan.InfinispanJGroupsChannelLookup"/>
        </properties>
    </transport>
    <globalJmxStatistics
        allowDuplicateDomains="true"
        enabled="true"
        jmxDomain="org.infinispan"
        cacheManagerName="SampleCacheManager"/>
</global>
<default>
    <clustering mode="replication">
        <sync/>
    </clustering>
    <jmxStatistics enabled="true"/>
</default>
<namedCache name="transactional-type">
    <transactional
        transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"
        syncRollbackPhase="true"
        syncCommitPhase="true"
        cacheStopTimeout="30000"
        uselPcForAutoCommitTransactions="true"
        autoCommit="true"
        lockingMode="OPTIMISTIC"
        useEagerLocking="true"
        useSynchronization="true"
        transactionMode="TRANSACTIONAL"
        />
        <clustering mode="replication">
        <sync/>
        </clustering>
</namedCache>
</infinispan>

jgroups 的配置如下。

<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance""
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
    <TCP loopback="true"
        bind_addr="$(cache.websessions.jgroups.bind.ip)"
        bind_port="$(cache.websessions.jgroups.bind.port)"
        recv_buf_size="20M"
        send_buf_size"640k"
        discard_incompatible_packets="true"
        max_bundle_size="64K"
        max_bundle_timeout="2=300"
        timer_type="new"
        timer.min_threads="4"
        timer.max_threads="10"
        timer.keep_alive_time="3000"
        timer.queue_max_size="500"
        thread_pool.enabled="true"
        thread_pool.min_threads="2"
        thread_pool.max_threads="30"
        thread_pool.keep_alive_time="60000"
        thread_pool.queue_enabled="false"
        thread_pool.queue_max_size="100"
        thread_pool.rejection_policy="discard"
        oob_thread_pool.min_threads="2"
        oob_thread_pool.max_threads="30"
        oob_thread_pool.keep_alive_time="60000"
        oob_thread_pool.queue_enabled="false"
        oob_thread_pool.queue_max_size="100"
        oob_thread_pool.rejection_policy="discard"/>
    <TCPGOSSIP initial_hosts="$(cache.websession.jgroups.members)"/>
    <MERGE2 max_interval="30000" min_interval="10000"/>
    <FD_SOCK/>
    <FD timeout=3000" max_tries="3"/>
    <VERIFY_SUSPECT timeout="1500"/>
    <pbcast.NAKACK
        use_mcast_xmit="false"
        retransmit_timeout="300,600,1200,2400,4800"
        discard_delivered_msgs="false"/>
    <UNICAST2 timeout="300,600,1200"
              stable_interval="5000"
              max_bytes="1m"/>
    <pbcast.STABLE stability_delay="500" desired_avg_gossip="5000" max_bytes="1m"/>
    <pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
    <UFC max_credits="200k" min_threshold="0.20"/>
    <MFC max_credits="200k" min_threshold="0.20"/>
    <FRAG2 frag_size="60000"/>
    <RSVP timeout="60000" resend_interval="500" ack_on_delivery="false"/>
</config>

这看起来像是一个非常古老的 Infinispan 版本。 不能考虑升级吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM