尽管配置了特定端口,Hazelcast仍使用临时端口进行出站流量

时间:2016-03-22 07:37:35

标签: java hazelcast

背景:

  • 我正在使用Hazelcast 3.5.2
  • 3个节点配置为单个群集的成员
  • 每个节点都有以下网络配置:

    <network>
    <port auto-increment="false">5701</port>
    <outbound-ports>
        <ports>10000-10005</ports>
    </outbound-ports>
    <join>
        <multicast enabled="false" />
        <tcp-ip enabled="true">
            <member-list>
                <member>{assume ip of node 1}</member>
                <member>{assume ip of node 2}</member>
                <member>{assume ip of node 3}</member>
            </member-list>
        </tcp-ip>
    </join>
    

  • 因此,每个节点有6个端口用于出站通信,根据我目前对hazelcast的理解,这对于3个节点就足够了。但是,在每个节点上执行 netstat 时,我注意到每个节点上的跟踪类似(假设{n}为某些非零数字)

    @node1 tcp {n} 0 {ip of node 1}:5701 {ip of node 2}:35576 ESTABLISHED tcp {n} 0 {ip of node 1}:5701 {ip of node 3}:10001 ESTABLISHED tcp 0 {n} {ip of node 1}:54941 {ip of node 2}:5701 ESTABLISHED tcp 0 {n} {ip of node 1}:10000 {ip of node 3}:5701 ESTABLISHED @node2 tcp {n} 0 {ip of node 2}:5701 {ip of node 1}:54941 ESTABLISHED tcp {n} 0 {ip of node 2}:5701 {ip of node 3}:10000 ESTABLISHED tcp 0 {n} {ip of node 2}:10003 {ip of node 1}:5701 ESTABLISHED tcp 0 {n} {ip of node 2}:35576 {ip of node 3}:5701 ESTABLISHED @node3 tcp {n} 0 {ip of node 3}:5701 {ip of node 1}:10000 ESTABLISHED tcp {n} 0 {ip of node 3}:5701 {ip of node 2}:10003 ESTABLISHED tcp 0 {n} {ip of node 3}:10001 {ip of node 1}:5701 ESTABLISHED tcp 0 {n} {ip of node 3}:10000 {ip of node 2}:5701 ESTABLISHED

查询:

  • 入站通信配置。受到所有节点的尊重。
  • 但是,两个节点(三个节点中的一个)总是为出站通信打开一些短暂的端口(并且不尊重为它们设置的网络配置。)
  • 有谁知道为什么?以及如何规避问题?

注意:我对hazelcast很新,所以如果我错过了提供的话,请询问具体细节。

1 个答案:

答案 0 :(得分:0)

是否可以在每个节点上分享lsof -a -i -n -P -p ${HAZELCAST_PID}ifconfig的结果?

据我所知(参见SocketConnector),当属性hazelcast.socket.client.bindtrue(默认值)时,Hazelcast将尝试绑定到提供的特定端口许多重试的<outbound-ports>元素,然后失败,异常与您看到的超出范围的客户端端口不一致。