Java 无法连接到远程apache ignite节点
我正在运行一个简单的代码来测试ApacheIgnite分布式缓存。一个节点 在服务器上,当我启动java程序时,另一个在本地运行Java 无法连接到远程apache ignite节点,java,ignite,Java,Ignite,我正在运行一个简单的代码来测试ApacheIgnite分布式缓存。一个节点 在服务器上,当我启动java程序时,另一个在本地运行 public class HelloIgnite { public static void main(String[] args) { System.out.println("Hello Ignite"); Ignite ignite = Ignition.start("example-cache.xml");
public class HelloIgnite {
public static void main(String[] args) {
System.out.println("Hello Ignite");
Ignite ignite = Ignition.start("example-cache.xml");
// get or create cache
IgniteCache<Integer, String> cache =
ignite.getOrCreateCache("testCache");
// put some cache elements
for(int i = 1; i <= 100; i++){
cache.put(i, Integer.toString(i));
}
// get them from the cache and write to the console
for(int i =1; i<= 100; i++){
System.out.println("Cache get:"+ cache.get(i));
}
ignite.close();
}
}
公共类黑柱石{
公共静态void main(字符串[]args){
System.out.println(“Hello Ignite”);
Ignite=Ignition.start(“example cache.xml”);
//获取或创建缓存
点火缓存=
ignite.getOrCreateCache(“testCache”);
//放置一些缓存元素
对于(int i=1;我建议从IP finder中删除127.0.0.1,并在详细模式下运行(IGNITE\u QUIET=false
),与我们共享输出。@alamar现在在本地节点上获得此消息“[2019-11-22 15:28:13654][WARN][main][TcpDiscoverySpi]节点尚未连接到拓扑,将重复连接过程。请检查远程节点日志以获取可能的错误消息。请注意,大型拓扑可能需要很长的启动时间。如果在启动节点上获取此消息,请增加“TcpDiscoverySpi.networkTimeout”配置属性[networkTimeout=10000]`您的服务器节点部署在哪里?请检查您是否没有遇到防火墙问题,并且指定的端口是否可用:47500-47509以及47100。它部署在远程服务器上。我检查了它,发现端口在没有防火墙的情况下打开。问题是我在本地启动的节点正在加入和离开群集,如图所示在服务器节点的日志输出上:[16:41:27]拓扑快照[ver=17,locNode=f3331aed,servers=3,clients=0,state=ACTIVE,cpu=56,offheap=41.0GB,heap=48.0GB][16:41:27]拓扑快照[ver=18,locNode=f3331aed,servers=2,clients=0,state=ACTIVE,cpu=48,offheap=38.0GB,heap=44.0GB]
<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">
<bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="peerClassLoadingEnabled" value="true"/>
<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>
<value>SERVER_IP:47500..47509</value>
</list>
</property>
</bean>
</property>
<property name="joinTimeout" value="1000"/>
</bean>
</property>
</bean>
</beans>