【问题标题】:How to connect apache ignite node by static ip address如何通过静态IP地址连接apache ignite节点
【发布时间】:2018-06-04 12:44:27
【问题描述】:

我有一个带有配置的 hetzner 服务器:

<bean id="ignite-configuration" class="org.apache.ignite.IgniteSpringBean">
    <property name="configuration">
        <bean class="org.apache.ignite.configuration.IgniteConfiguration">
            <property name="peerClassLoadingEnabled" value="true"/>
            <property name="igniteInstanceName" value="statistic-server"/>

            <property name="discoverySpi">
                <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                    <property name="ipFinder">
                        <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                            <property name="addresses">
                                <list>
                                    <value>127.0.0.1:47500..47509</value>
                                </list>
                            </property>
                        </bean>
                    </property>
                </bean>
            </property>
        </bean>
    </property>
</bean>

我想像服务器节点一样将我的笔记本电脑连接到服务器。在我的笔记本电脑上,我有下一个配置:

<property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                    <property name="addresses">
                        <list>
                            <value>hetzner_ip_address:47500..47509</value>
                        </list>
                    </property>
                </bean>
            </property>
            <property name="addressResolver">
                <bean class="org.apache.ignite.configuration.BasicAddressResolver">
                    <constructor-arg>
                        <map>
                            <entry key="192.168.1.10" value="laptop_static_ip_address"/>
                        </map>
                    </constructor-arg>
                </bean>
            </property>
        </bean>
    </property>

我可以通过静态 IP 地址连接 NAT 后面的服务器吗?我该怎么做?

【问题讨论】:

  • 如果服务器在 NAT 之后,唯一的连接方式是在 NAT 机器上设置端口转发并使用 NAT 设备的外部 IP 地址。这不太可能被允许。另一种方法是 VPN 或 SSH 隧道。解释这些对于 StackOverflow 来说是题外话,因为它们是网络配置问题,与编程无关。
  • 吉姆,你能给我一个链接吗?
  • NAT、VPN 和 SSH 隧道在网络上都有很好的记录。使用您最喜欢的搜索引擎。
  • Jim,抱歉,如果你知道的话,我必须在服务器节点上设置 ssh 隧道吗?

标签: java tcp ip-address ignite


【解决方案1】:

目前还不清楚是否有 NAT 后面的客户端或服务器节点,但实际上在 Ignite 中,服务器节点有时可以与客户端节点建立连接,因此您需要确保允许双向连接。

在 NAT 的情况下,这意味着除了AddressResolver,您还需要在路由器上配置端口转发,或者使用 SSH 隧道。

【讨论】:

  • 非常感谢。我在我的 hetzner 服务器上创建了 VPN 服务器并将我的客户端节点连接到 vpn。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-07-18
  • 1970-01-01
  • 2014-09-06
  • 2020-04-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多