Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用hazelcast时地图未准备就绪_Java_Hazelcast - Fatal编程技术网

Java 使用hazelcast时地图未准备就绪

Java 使用hazelcast时地图未准备就绪,java,hazelcast,Java,Hazelcast,我使用的是hazelcast v3.2.4客户端和服务器。服务器从数据库加载数据-此问题不会发生在数据较少的情况下,因此我猜测其数据大小与此相关,但需要确认。我在服务器中有两个节点用于测试——一旦知道问题所在,我可以添加更多节点。下面提供了我用于hazelcast地图的地图配置。我不确定我是否以某种方式对地图进行了错误配置。客户端和服务器上的错误如下所示。我不确定是它的GC还是节点上太多的数据simple top check显示内存使用率低于35%——我将很快使用jvisualvm进行检查 客户

我使用的是hazelcast v3.2.4客户端和服务器。服务器从数据库加载数据-此问题不会发生在数据较少的情况下,因此我猜测其数据大小与此相关,但需要确认。我在服务器中有两个节点用于测试——一旦知道问题所在,我可以添加更多节点。下面提供了我用于hazelcast地图的地图配置。我不确定我是否以某种方式对地图进行了错误配置。客户端和服务器上的错误如下所示。我不确定是它的GC还是节点上太多的数据simple top check显示内存使用率低于35%——我将很快使用jvisualvm进行检查

客户端错误

服务器


确保您执行了以下所有操作来调试并修复

在运行hazelcast服务器的服务器上运行jstatd,例如。 jstatd-J-Djava.security.policy=jstatd.all.policy-J-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx 然后连接jvisualvm以了解服务器应用程序的情况。您还可以使用top获取流程的基本信息

分享您如何启动java进程—服务器上有多少可用内存。您指定的java进程的Xms和Xmx值是什么

如果仅仅改变步骤2并不能解决您的问题,请尝试使用G1GC

如果步骤2和步骤3不起作用,请尝试向服务器群集添加更多服务器

这是在运行服务器之后还是在运行一段时间之后发生的?内存使用情况是否会根据应用程序的工作方式而变化


我增加了Xms和Xmx,并切换到G1GC,这个问题似乎已经消失了。顶部显示了几乎90%的内存使用率。因此,要么我需要减少内存中的数据,要么添加更多节点。
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>