How to use gridgain with two nodes where each node on its own different host

我们两清 提交于 2019-12-04 21:04:10

Compute examples are configured to work with local host settings. All you have to do is update IP addresses in examples/config/example-compute.xml file to the IP addresses in your environment. You only need to provide at least 1 IP address of the node you plan to start first, but you can provide more just in case.

Here are the configuration changes you have to make:

<bean id="grid.cfg" class="org.gridgain.grid.GridConfiguration">
    <!-- Remove this configuration property. -->
    <!--<property name="localHost" value="127.0.0.1"/>-->

    ...

    <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
    <property name="discoverySpi">
        <bean class="org.gridgain.grid.spi.discovery.tcp.GridTcpDiscoverySpi">
            <property name="ipFinder">
                <!-- Uncomment multicast IP finder to enable multicast-based discovery of initial nodes. -->
    <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.multicast.GridTcpDiscoveryMulticastIpFinder">
                    <property name="addresses">
                        <list>
                            <!-- In distributed environment, replace with actual host IP address. -->
                            <value>127.0.0.1:47500..47509</value>
                        </list>
                    </property>
                </bean>
            </property>
        </bean>
    </property>
</bean>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!