2017-06-06 87 views
1

當我嘗試用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,但我無法找到如何使編程

+0

你肯定有不只是一個防火牆阻止端口5701? – noctarius

+0

@noctarius,是的,我敢肯定 – anatoli

回答

0

您是否嘗試過做一個telnet的名稱IP地址和端口。如果telnet失敗,那麼如果您提供公共IP,則需要打開防火牆端口。

的telnet IP端口

+0

netcat和telnet已經工作 – anatoli

+0

你可以檢查計算機上的網絡設置..它有多個網卡嗎? – Riaz