gpt4 book ai didi

java - Hazelcast 未连接到 5704 端口

转载 作者:行者123 更新时间:2023-12-01 08:58:11 27 4
gpt4 key购买 nike

我在 4 个实例中启动了 hazelcast 服务器。对于每个实例,我给出了不同的组名称。现在,当我尝试从客户端连接到 4 个实例时,它失败了。 Hazelcast 默认情况下仅检查 5701,5702,5703,甚至不查找 5704。我如何配置 hazelcast 客户端来查找所有实例以下是日志

com.hazelcast.client.AuthenticationException: Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)12:30:22.570 [hz.client_0.internal-2] WARNcom.hazelcast.client.connection.nio.ClientConnection - hz.client_0[PAVAN] [3.7.4] ClientConnection{live=false, connectionId=2,socketChannel=DefaultSocketChannelWrapper{socketChannel=java.nio.channels.SocketChannel[connectedlocal=/127.0.0.1:34798 remote=/127.0.0.1:5702]}, remoteEndpoint=null,lastReadTime=2017-01-25 12:30:22.569, lastWriteTime=2017-01-2512:30:22.568, closedTime=2017-01-25 12:30:22.569,lastHeartbeatRequested=never, lastHeartbeatReceived=never, connectedserver version=null} lost. Reason:com.hazelcast.client.AuthenticationException[Invalid credentials!]12:30:22.570 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Exception during initial connection tolocalhost/127.0.0.1:5702 com.hazelcast.client.AuthenticationException:Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)12:30:22.574 [hz.client_0.internal-2] WARNcom.hazelcast.client.connection.nio.ClientConnection - hz.client_0[PAVAN] [3.7.4] ClientConnection{live=false, connectionId=3,socketChannel=DefaultSocketChannelWrapper{socketChannel=java.nio.channels.SocketChannel[connectedlocal=/127.0.0.1:58426 remote=/127.0.0.1:5701]}, remoteEndpoint=null,lastReadTime=2017-01-25 12:30:22.573, lastWriteTime=2017-01-2512:30:22.571, closedTime=2017-01-25 12:30:22.573,lastHeartbeatRequested=never, lastHeartbeatReceived=never, connectedserver version=null} lost. Reason:com.hazelcast.client.AuthenticationException[Invalid credentials!]12:30:22.574 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Exception during initial connection tolocalhost/127.0.0.1:5701 com.hazelcast.client.AuthenticationException:Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)12:30:22.575 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Unable to get alive cluster connection, try in 2955 mslater, attempt 1 of 2. 12:30:25.534 [hz.client_0.internal-2] WARNcom.hazelcast.client.connection.nio.ClientConnection - hz.client_0[PAVAN] [3.7.4] ClientConnection{live=false, connectionId=4,socketChannel=DefaultSocketChannelWrapper{socketChannel=java.nio.channels.SocketChannel[connectedlocal=/127.0.0.1:34802 remote=/127.0.0.1:5702]}, remoteEndpoint=null,lastReadTime=2017-01-25 12:30:25.533, lastWriteTime=2017-01-2512:30:25.533, closedTime=2017-01-25 12:30:25.533,lastHeartbeatRequested=never, lastHeartbeatReceived=never, connectedserver version=null} lost. Reason:com.hazelcast.client.AuthenticationException[Invalid credentials!]12:30:25.535 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Exception during initial connection tolocalhost/127.0.0.1:5702 com.hazelcast.client.AuthenticationException:Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)12:30:25.538 [hz.client_0.internal-2] WARNcom.hazelcast.client.connection.nio.ClientConnection - hz.client_0[PAVAN] [3.7.4] ClientConnection{live=false, connectionId=5,socketChannel=DefaultSocketChannelWrapper{socketChannel=java.nio.channels.SocketChannel[connectedlocal=/127.0.0.1:58430 remote=/127.0.0.1:5701]}, remoteEndpoint=null,lastReadTime=2017-01-25 12:30:25.537, lastWriteTime=2017-01-2512:30:25.537, closedTime=2017-01-25 12:30:25.537,lastHeartbeatRequested=never, lastHeartbeatReceived=never, connectedserver version=null} lost. Reason:com.hazelcast.client.AuthenticationException[Invalid credentials!]12:30:25.539 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Exception during initial connection tolocalhost/127.0.0.1:5701 com.hazelcast.client.AuthenticationException:Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)12:30:25.545 [hz.client_0.internal-2] WARNcom.hazelcast.client.connection.nio.ClientConnection - hz.client_0[PAVAN] [3.7.4] ClientConnection{live=false, connectionId=6,socketChannel=DefaultSocketChannelWrapper{socketChannel=java.nio.channels.SocketChannel[connectedlocal=/127.0.0.1:49389 remote=/127.0.0.1:5703]}, remoteEndpoint=null,lastReadTime=2017-01-25 12:30:25.542, lastWriteTime=2017-01-2512:30:25.541, closedTime=2017-01-25 12:30:25.542,lastHeartbeatRequested=never, lastHeartbeatReceived=never, connectedserver version=null} lost. Reason:com.hazelcast.client.AuthenticationException[Invalid credentials!]12:30:25.545 [main] WARNcom.hazelcast.client.spi.impl.ClusterListenerSupport - hz.client_0[PAVAN] [3.7.4] Exception during initial connection tolocalhost/127.0.0.1:5703 com.hazelcast.client.AuthenticationException:Invalid credentials! atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:525)atcom.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:507)atcom.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)atjava.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745) atcom.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)atcom.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)

public class HCServer {

public static void main(String[] args) {
System.setProperty("hazelcast.tcp.join.port.try.count", "10");
String hazelcastGroup = args[0];
Config config = new Config();
config.getGroupConfig().setName(hazelcastGroup).setPassword(hazelcastGroup);
Hazelcast.newHazelcastInstance(config);
}
}



public class HcClient {
public static void main(String[] args) {
System.setProperty("hazelcast.tcp.join.port.try.count", "10");
String hazelcastGroup = args[0];
ClientConfig clientConfig = new ClientConfig();
clientConfig.getGroupConfig().setName(hazelcastGroup).setPassword(hazelcastGroup);
HazelcastClient.newHazelcastClient(clientConfig);
}

}

最佳答案

不确定您的确切问题是什么,因为您的异常(exception)似乎与我读到的您的问题无关。无论如何,异常(exception)是关于无效凭据(com.hazelcast.client.AuthenticationException:无效凭据),这意味着您的客户端具有与其想要连接的节点不同的组名/密码配置。

另一方面,我不确定“4 个节点,所有不同的组名”是什么意思,这背后的想法是什么?如果您想要一个 4 节点集群,它们都应该具有相同的组名和密码,客户端也应该如此。如果您想要 4 个独立的集群,则需要创建 4 个 Hazelcast 客户端,每个客户端都有自己独特的配置(每个客户端都与一个集群的组配置匹配)。

连接5703以上端口,需要专门配置地址,将其添加到要连接的地址中,通用格式为ip:port。

总的来说,我看到很多事情似乎都是错误的,我不确定你现在尝试做什么,但我希望它仍然有帮助。

关于java - Hazelcast 未连接到 5704 端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41890447/

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