當我嘗試用Hazelcast連接到外部地址
ClientConfig clientConfig = new ClientConfig();
ClientNetworkConfig cnc = clientConfig.getNetworkConfig();
cnc.addAddress("127.0.0.1:5701");
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);
這工作正常連接本地集羣。 而是通過連接外部ADRESS,我怎麼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
@noctarius,是的,我敢肯定 – anatoli