gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 21:13:20 28 4
gpt4 key购买 nike

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

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

本例中,“12dshost10”代表本地服务器,所有节点名称正确,“12dshost11”代表远程服务器,其他异常节点名称实际上来自< em>12dshost11”。我不知道为什么他们会变成这样。

在这种情况下,这个集群无法正常工作,当涉及到 session 缓存的过程时,这些异常节点总是在等待15秒后抛出TimeoutException。看起来与这些异常节点无法通信。在这段时间里,我所有的请求也会被阻塞,直到Exception throw。我看了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 的一个非常古老的版本。你不能考虑升级吗?

关于java - 使用 infinispan 进行 http session 集群和缓存时经常出现 TimeoutException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58891034/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com