当重新启动唯一的hazelcast服务器节点时,我在hazelcast客户端重新连接上遇到异常:
SEVERE: Error while fetching cluster partition table!
com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is not ready yet!
at com.hazelcast.client.impl.ClientEngineImpl$ClientPacketProcessor.processRequest(ClientEngineImpl.java:423)
at com.hazelcast.client.impl.ClientEngineImpl$ClientPacketProcessor.run(ClientEngineImpl.java:346)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)
at ------ End remote and begin local stack-trace ------.(Unknown Source)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl.sendAndReceive(ClientConnectionManagerImpl.java:500)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl.authenticate(ClientConnectionManagerImpl.java:474)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl.access$2100(ClientConnectionManagerImpl.java:85)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl$ClusterAuthenticator.auth(ClientConnectionManagerImpl.java:461)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl$ConnectionProcessor.call(ClientConnectionManagerImpl.java:395)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl$ConnectionProcessor.call(ClientConnectionManagerImpl.java:353)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.hazelcast.util.executor.CompletableFutureTask.run(CompletableFutureTask.java:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)
这不会阻止客户端重新连接,几秒钟后客户端会重新连接:
INFO: HazelcastClient[hz.client_0_dev][3.4.2] is CLIENT_CONNECTED
有什么想法,以及如何阻止此日志出现?
我在本地运行服务器和客户端。
服务器配置:
private static Config createServerConfig(int port, String members) {
Config config = new Config();
NetworkConfig network = config.getNetworkConfig();
network.setPort(port);
network.setPortAutoIncrement(true);
JoinConfig join = network.getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true);
for (String host : members.split(";")) {
join.getTcpIpConfig().addMember(host);
}
return config;
}
客户端配置:
private static ClientConfig createClientConfig(String members) {
ClientConfig config = new ClientConfig();
ClientNetworkConfig cnc = new ClientNetworkConfig();
cnc.setConnectionAttemptLimit(0);
for (String host : members.split(";")) {
cnc.addAddress(host);
}
config.setNetworkConfig(cnc);
return config;
}
答案 0 :(得分:2)
这不是一个破坏性的例外。分区表定期更新,无法更新分区表不会影响一致性。只有问题是群集更改后的短时间内的性能。
不幸的是,没有办法防止这种情况发生。对于我们这方面,似乎打印这个因为SEVERE日志开始是错误的。如果您在https://github.com/hazelcast/处提交了问题,则可以跟踪相关修复的过程。