Hazelcast无法加载分布式地图条目

时间:2018-09-11 06:26:09

标签: java spring hazelcast

我们在项目中使用了Hazelcast分布式地图。 交付后,它只是停止从数据库中读取条目。储存作品。在本地,我们无法重现该问题。

我们尝试重新启动服务器或清空数据库表,但没有成功。映射始终为空:

    @Autowired
    @Qualifier("hazelcast")
    private transient HazelcastInstance hazelcastInstance;
    ....
    hazelcastInstance.getMap(MAP_NAME).keySet() ;//is empty

地图的Hazelcast配置:

<hz:hazelcast id="hazelcast">
        <hz:config>
            <hz:group name="${hazelcast.clustername}" password="${hazelcast.password}" />
            <hz:properties>
                <hz:property name="hazelcast.logging.type">slf4j</hz:property>
                <hz:property name="hazelcast.jmx">${hazelcast.jmx:true}</hz:property>
            </hz:properties>
            <hz:network port="${hazelcast.port:8801}"
                port-auto-increment="${hazelcast.auto-increment:true}">
                <hz:join>
                    <hz:multicast enabled="${hazelcast.multicast-enabled:false}"
                        multicast-group="${hazelcast.multicast-group}"
                        multicast-port="${hazelcast.multicast-port}" />
                    <hz:tcp-ip enabled="${hazelcast.tcp-ip-enabled:true}">
                        <hz:members>${hazelcast.tcp-ip-members}</hz:members>
                    </hz:tcp-ip>
                </hz:join>
            </hz:network>    
<hz:map name="maps.*" backup-count="2" max-size="0" eviction-percentage="30" read-backup-data="true" eviction-policy="NONE" merge-policy="com.hazelcast.map.merge.PassThroughMergePolicy">
            <hz:map-store enabled="true" write-delay-seconds="0" implementation="persistenceProvider"/>
        </hz:map>

我们的应用程序基于Spring。 PersistenceProvider类仅实现com.hazelcast.core.MapLoader和com.hazelcast.core.MapStore以便处理数据库中的条目。

@Component
public class PersistenceProvider implements MapLoader<Key, Value>, MapStore<Key, Value> {...}

在日志中,我只看到了可能不相关的条目:

[hz._hzInstance_1_Cluster.cached.thread-2] INFO  com.hazelcast.nio.tcp.TcpIpConnector.log | [xxx]:8801 Could not connect to: /yyy:8802. Reason: SocketException[Verbindungsaufbau abgelehnt to address /yyyy:8802]
[hz._hzInstance_1_Cluster.cached.thread-2] INFO  c.hazelcast.cluster.impl.TcpIpJoiner.log | [xxx]:8801 [xxx]:8802 is added to the blacklist.

提醒一下:该代码以前可以工作,可以在本地工作,但现在在此环境中只能存储hazelcast数据,而不能加载!

我是Hazelcast的新手,我想知道这可能是缓存问题还是我们可以在配置中更改的内容。

重要的是要取消阻止它,因为客户无法使用该应用程序。

你有什么主意吗?

0 个答案:

没有答案
相关问题