问题描述
我是 Apache Ignite 的新手,这是我正在尝试做的事情 我正在使用默认配置 xml(服务器端配置)在本地运行 GridGain。我想我们可以说这是来自服务器端的配置。现在我有我的应用程序,它来自需要监听本地运行的 gridgain 的客户端。我的目标是我需要从我的应用程序指向本地运行的集群
我面临以下问题:
[org.apache.ignite.spi.discovery.tcp.TcpdiscoverySpi] (tcp-client-disco-msg-worker-#4-#59) 无法从 IP finder 连接到任何地址(将重试加入拓扑每 2000 毫秒;更改 'reconnectDelay' 以配置重试频率):[/127.0.0.1:48500,/127.0.0.1:48501,/127.0.0.1:48502] [stdout] (tcp-client-disco-msg-worker-#4-#59) [10:31:48] 无法从 IP finder 连接到任何地址(将每 2000 毫秒重试加入拓扑;更改“reconnectDelay”配置重试频率):[/127.0.0.1:48500,/127.0.0.1:48502]
服务器端配置:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
Alter configuration below as needed.
-->
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="communicationSpi">
<bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
<property name="localPort" value="48100"/>
</bean>
</property>
</bean>
</beans>
客户端配置:
<bean name="igniteClientConfig" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="clientMode" value="true"/>
<property name="discoverySpi" ref="tcpdiscoverySpi"/>
</bean>
<bean name="tcpdiscoverySpi" class="org.apache.ignite.spi.discovery.tcp.TcpdiscoverySpi">
<!-- Initial local port to listen to. -->
<property name="localPort" value="48500"/>
<!-- Changing local port range. This is an optional action. -->
<property name="localPortRange" value="20"/>
<property name="ipFinder" ref="tcpdiscoveryVmIpFinder"/>
</bean>
<bean name="tcpdiscoveryVmIpFinder" class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpdiscoveryVmIpFinder">
<property name="addresses" ref="IPaddresses"/>
</bean>
<util:list id="IPaddresses" value-type="java.lang.String">
<value>127.0.0.1:48500</value>
<value>127.0.0.1:48501</value>
<value>127.0.0.1:48502</value>
</util:list>
解决方法
您应该对所有节点(服务器和客户端)使用相同的 discoverySpi 和communicationSpi 配置