【发布时间】:2017-06-06 16:14:32
【问题描述】:
当我尝试连接本地集群时
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,但我找不到如何以编程方式制作它
【问题讨论】:
-
您确定不只是防火墙阻止了 5701 端口吗?
-
@noctarius,是的,我确定