仅使用简单的分布式缓存时,如何为 Ignite 打开最少数量的端口?

How to open the bare minimum number of ports for Ignite when only using a simple distributed cache?

这个问题是关于: Ports required for Apache Ignite Cluster

就我而言,Apache ignite 只有一个用途,即几个简单的分布式 Cache<String, String> 对象。我有 6 个服务器节点,它们都需要异步共享这些缓存。

我的网络团队只想为我的用例打开最少数量的端口。我们不需要任何花哨的东西。我们不会使用多播。我们将指定所有 6 个节点的 IP,Port 以用于发现。

这是我将要使用的代码:

TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500"));
tcpDiscoverySpi.setIpFinder(ipFinder);

到目前为止一切顺利。我 运行 在开发集群上进行了测试,我可以验证缓存是否正确分布。这个开发集群是同一台机器上的2台JBoss台服务器。

现在我要在 6 个独立的 VM 上部署它。

这会变成ipFinder.setAddresses(Arrays.asList("10.0.1.5:47500", "10.0.1.6:47500", "10.0.1.7:47500", "10.0.1.8:47500", "10.0.1.9:47500", "10.0.1.10:47500"));吗?

我的代码中有大约 8 个不同的 Cache<String, String>。我使用的缓存对象数量是否会影响我需要的端口数量?

47500 是我用例中唯一使用的端口吗?如果没有,我还需要哪些其他端口?我如何设置它以使用我的用例的绝对最小端口数?

对于最低限度
你需要发现(默认端口47500)和通信(默认端口47100)

参见:https://ignite.apache.org/docs/latest/clustering/tcp-ip-discovery 和:https://ignite.apache.org/docs/latest/clustering/network-configuration#communication
注意端口范围参数,因为 Ignite 会使用它来寻找可用的 如果采用默认端口,则为端口。 看: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.html#setLocalPortRange-int- https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.html#setLocalPortRange-int-

以下为可选项:
8080 — REST API 端口 - https://ignite.apache.org/docs/latest/restapi

11211 - 用于使用 visor/control.sh 工具
https://ignite.apache.org/docs/latest/tools/control-script#connecting-to-cluster
https://ignite.apache.org/docs/latest/tools/visor-cmd

49112 — 默认 JMX 端口(此端口在以后的版本中可能会更改)

10800 — 精简 client/JDBC/ODBC 端口
https://ignite.apache.org/docs/latest/thin-clients/getting-started-with-thin-clients#configuring-thin-client-connector