首页 > 解决方案 > Jgroup port selection control externally

问题描述

We have a Jgroup cluster with tcpgossip protocol as discovery service. Currently each node of the cluster member get assigned with a random TCP port by jgroup GMS: address=XXX, cluster=cluster, physical address=1.100.102.34:50970

Is there any way we can specify the port range to choose externally without changing the Jgroup configuration. That is using any linux command like iptables rules , can we specify a port range , so that Jgroup will pick ports only from that range

标签: javajgroups

解决方案


根据文档,您可以bind_port为您配置的 jgroup 传输协议栈指定。

bind_port:传输绑定的端口。默认值 0 绑定到任何(临时)端口

示例代码片段:

<config>
  <TCP
     singleton_name="tcp"
     bind_port=12345
     ...
    />
</config>

推荐阅读