当我尝试将本地群集与

ClientConfig clientConfig = new ClientConfig();
ClientNetworkConfig cnc = clientConfig.getNetworkConfig();
cnc.addAddress("127.0.0.1:5701");
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);


这很好。
但是通过连接到外部地址,我如何收到10.0.0.1:5701

Exception in thread "main" java.lang.IllegalStateException: Unable to connect to any address in the config! The following addresses were tried:[/10.0.0.1:5701]
at com.hazelcast.client.spi.impl.ClusterListenerSupport.connectToCluster(ClusterListenerSupport.java:174)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.start(ClientClusterServiceImpl.java:191)


如何设置HazelcastClient连接IP 10.0.0.1? (以编程方式或使用xml)

我已经看过Hazelcast: connecting to remote cluster了,但是我找不到如何编程的方式

最佳答案

您是否尝试过对IP地址和端口进行telnet。 telnet发生故障时,如果要提供公用IP,则需要打开防火墙端口。 telnet ip端口

关于java - Hazelcast连接到外部地址,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44395054/

10-09 04:03