gpt4 book ai didi

java - Hazelcast 连接到外部地址

转载 作者:太空宇宙 更新时间:2023-11-04 11:25:44 26 4
gpt4 key购买 nike

当我尝试连接本地集群时

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但我找不到如何以编程方式实现它

最佳答案

您是否尝试过通过 telnet 访问 IP 地址和端口。如果 telnet 失败,那么如果您提供公共(public) IP,则需要打开防火墙端口。

telnet ip port

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

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