为什么Hazelcast尝试连接到另外两个端口 [英] Why Hazelcast tries to connect to another two ports

查看:100
本文介绍了为什么Hazelcast尝试连接到另外两个端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用IP 127.0.0.1和端口5701启动Hazelcast.为什么它尝试连接另外两个端口5702和5703?他们是做什么用的,为什么连接失败?

I start Hazelcast with IP 127.0.0.1 and port 5701. Why it tries to connect another two ports 5702 and 5703? What are they used for, and why it failed to connect?

以下是我如何以编程方式进行配置:

Below is how I configure programmatically:

Config config = new Config();        
NetworkConfig network = config.getNetworkConfig(); 
network.setPort(5701);
JoinConfig join = network.getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true);
join.getTcpIpConfig().addMember("127.0.0.1");

下面是启动hazelcast时的日志.

Below is the log when starting hazelcast.

INFO: [127.0.0.1]:5701 [dev] [3.6.3] Creating TcpIpJoiner

Jun 22, 2016 11:58:41 AM com.hazelcast.core.LifecycleService
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Address[127.0.0.1]:5701 is STARTING

Jun 22, 2016 11:58:41 AM com.hazelcast.nio.tcp.nonblocking.NonBlockingIOThreadingModel
INFO: [127.0.0.1]:5701 [dev] [3.6.3] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads

Jun 22, 2016 11:58:41 AM com.hazelcast.nio.tcp.InitConnectionTask
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Connecting to /127.0.0.1:5702, timeout: 0, bind-any: true

Jun 22, 2016 11:58:41 AM com.hazelcast.nio.tcp.InitConnectionTask
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Connecting to /127.0.0.1:5703, timeout: 0, bind-any: true

Jun 22, 2016 11:58:41 AM com.hazelcast.nio.tcp.InitConnectionTask
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Could not connect to: /127.0.0.1:5702. Reason: SocketException[Connection refused to address /127.0.0.1:5702]

Jun 22, 2016 11:58:41 AM com.hazelcast.nio.tcp.InitConnectionTask
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Could not connect to: /127.0.0.1:5703. Reason: SocketException[Connection refused to address /127.0.0.1:5703]

Jun 22, 2016 11:58:41 AM com.hazelcast.cluster.impl.TcpIpJoiner
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Address[127.0.0.1]:5702 is added to the blacklist.

Jun 22, 2016 11:58:41 AM com.hazelcast.cluster.impl.TcpIpJoiner
INFO: [127.0.0.1]:5701 [dev] [3.6.3] Address[127.0.0.1]:5703 is added to the blacklist.

Jun 22, 2016 11:58:42 AM com.hazelcast.cluster.impl.TcpIpJoiner
INFO: [127.0.0.1]:5701 [dev] [3.6.3]

谢谢!

推荐答案

无论何时启动Hazelcast成员,它都会首先尝试查看具有当前配置的任何其他集群成员是否已经可用.如果找到一个,它将加入它们以形成集群,否则将仅以单个成员启动集群.
默认情况下,它将检查相邻的端口,即您的情况是5702、5703.

Whenever you start a Hazelcast member, it first tries to see if any other cluster members with the current configuration are already available or not. If it finds one, it will join them to form the cluster otherwise it will just start the cluster with single member.
By default, it will check the neighboring ports i.e, in your case 5702, 5703.

这篇关于为什么Hazelcast尝试连接到另外两个端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆