我正在使用hazelcast v3.2.4客户端和服务器。服务器从数据库加载数据 - 这个问题不会发生在数据量较少的情况下,因此我猜测其数据大小相关但需要确认。我在服务器中有两个节点用于测试 - 一旦我知道问题就可以添加更多节点。下面提供了我用于我的hazelcast地图的地图配置。我不确定我是否以某种方式错误配置了地图。客户端和服务器上的错误如下所示。我不确定它的GC或节点上的数据太多(简单的顶部检查显示内存使用率低于35% - 我将尽快使用jvisualvm检查)
客户端错误
Exception in thread "main" com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
at com.hazelcast.map.DefaultRecordStore.checkIfLoaded(DefaultRecordStore.java:138)
at com.hazelcast.map.operation.MapSizeOperation.run(MapSizeOperation.java:36)
at com.hazelcast.spi.impl.BasicOperationService.processOperation(BasicOperationService.java:363)
at com.hazelcast.spi.impl.BasicOperationService.processPacket(BasicOperationService.java:309)
at com.hazelcast.spi.impl.BasicOperationService.access$400(BasicOperationService.java:102)
at com.hazelcast.spi.impl.BasicOperationService$BasicOperationProcessorImpl.process(BasicOperationService.java:766)
at com.hazelcast.spi.impl.BasicOperationScheduler$PartitionThread.process(BasicOperationScheduler.java:276)
at com.hazelcast.spi.impl.BasicOperationScheduler$PartitionThread.doRun(BasicOperationScheduler.java:270)
at com.hazelcast.spi.impl.BasicOperationScheduler$PartitionThread.run(BasicOperationScheduler.java:245)
at ------ End remote and begin local stack-trace ------.(Unknown Source)
at com.hazelcast.spi.impl.BasicInvocation$InvocationFuture.resolveResponse(BasicInvocation.java:862)
at com.hazelcast.spi.impl.BasicInvocation$InvocationFuture.resolveResponseOrThrowException(BasicInvocation.java:795)
at com.hazelcast.spi.impl.BasicInvocation$InvocationFuture.get(BasicInvocation.java:698)
at com.hazelcast.spi.impl.BasicInvocation$InvocationFuture.get(BasicInvocation.java:676)
at com.hazelcast.spi.impl.BasicOperationService.invokeOnPartitions(BasicOperationService.java:623)
at com.hazelcast.spi.impl.BasicOperationService.invokeOnAllPartitions(BasicOperationService.java:549)
at com.hazelcast.client.ClientEngineImpl.invokeOnAllPartitions(ClientEngineImpl.java:175)
at com.hazelcast.client.AllPartitionsClientRequest.process(AllPartitionsClientRequest.java:29)
at com.hazelcast.client.ClientEngineImpl$ClientPacketProcessor.processRequest(ClientEngineImpl.java:499)
at com.hazelcast.client.ClientEngineImpl$ClientPacketProcessor.run(ClientEngineImpl.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.hazelcast.util.executor.PoolExecutorThreadFactory$ManagedThread.run(PoolExecutorThreadFactory.java:59)
服务器
2014-09-11 11:37:54,525 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@22110814, partitionId=42, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,525 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@7c6003d7, partitionId=51, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,525 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@4968024, partitionId=40, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,525 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@199a9735, partitionId=44, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,525 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@7a7827d7, partitionId=48, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,526 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@561be5e7, partitionId=53, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,526 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@33531304, partitionId=46, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,526 WARN c.h.s.i.BasicInvocation [hz._hzInstance_1_testApp.response] [xxx.xxx.xxx.xxx]:5701 [testApp] [3.2.4] Retrying invocation: BasicInvocation{ serviceName='hz:impl:mapService', op=com.hazelcast.map.operation.MapSizeOperation@66bcc8a0, partitionId=55, replicaIndex=0, tryCount=250, tryPauseMillis=500, invokeCount=240, callTimeout=60000, target=Address[192.168.110.159]:5701}, Reason: com.hazelcast.spi.exception.RetryableHazelcastException: Map is not ready!!!
2014-09-11 11:37:54,526 WARN c.h.
<map name="testMap">
<in-memory-format>BINARY</in-memory-format>
<backup-count>0</backup-count>
<async-backup-count>1</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>
<max-size policy="PER_NODE">0</max-size>
<eviction-percentage>25</eviction-percentage>
<initial-load-mode>EAGER</initial-load-mode>
<map-store enabled="true">
<class-name>models.hazelcast.storeload.TestStoreLoad</class-name>
<write-delay-seconds>0</write-delay-seconds>
</map-store>
<entry-listeners>
<entry-listener include-value="true" local="false">models.hazelcast.listeners.TestListener</entry-listener>
</entry-listeners>
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
</map>
答案 0 :(得分:0)
确保执行以下所有操作以进行调试并希望修复
然后附上jvisualvm以弄清楚您的服务器应用程序发生了什么。您还可以使用top来获取有关流程的基本信息。
分享您启动Java进程的方式 - 您在服务器上可用的内存量。您指定的java进程的Xms和Xmx值是什么。
尝试使用G1GC - 如果只是改变步骤2并不能解决您的问题。
如果步骤2和步骤3不起作用,请尝试向服务器群集添加更多服务器。
这是在您运行服务器之后还是在运行一段时间后发生的 - 内存使用情况是否会根据应用程序的工作方式而改变?