多服务架构下无法连接远程Ignite节点问题求助
Ignite节点连接失败问题排查与解决
问题场景
同一VPC内多服务器部署服务集群:
- 1个主服务负责与Ignite服务器节点交互(创建、获取缓存)
- 其余服务通过主服务执行缓存操作
- 其他服务启动正常,但日志持续抛出连接失败错误:
class org.apache.ignite.IgniteCheckedException: Failed to connect to node (is node still alive?). Make sure that each ComputeTask and cache Transaction has a timeout set in order to prevent parties from waiting forever in case of network issues [nodeId=0c7caa96-2fdf-4e00-8f92-a7b690d89815, addrs=[/10.3.0.8:47100, /127.0.0.1:47100, 0:0:0:0:0:0:0:1%lo/:47100]]
排查与解决步骤
1. 修正主服务节点的Ignite网络绑定配置
Ignite节点默认可能仅绑定本地回环地址(127.0.0.1),导致跨服务器无法访问。需强制绑定到VPC内网IP(10.3.0.8):
- 修改Ignite配置文件(如
ignite-config.xml):
<bean class="org.apache.ignite.configuration.IgniteConfiguration"> <!-- 绑定到VPC内网IP --> <property name="localAddress" value="10.3.0.8"/> <!-- 指定对外暴露的通信地址 --> <property name="addresses"> <list> <value>10.3.0.8:47100</value> </list> </property> </bean>
- 重启主服务与Ignite节点,验证配置生效。
2. 验证VPC内端口连通性
在其他服务所在服务器执行端口连通性测试:
# 使用telnet测试 telnet 10.3.0.8 47100 # 或使用nc测试 nc -zv 10.3.0.8 47100
若连接失败,检查:
- 主服务服务器的防火墙/安全组是否开放47100(通信端口)和47500(发现端口)
- VPC内网路由规则是否允许服务器间跨节点通信
- 服务器网络接口是否正常启用
3. 检查Ignite节点发现机制配置
确保主服务的Ignite客户端配置正确指向Ignite服务器节点的内网地址,而非本地地址:
<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>10.3.0.8:47500</value> <!-- Ignite默认发现端口 --> </list> </property> </bean> </property> </bean> </property>
4. 确认主服务节点状态
登录主服务所在服务器,检查Ignite节点运行状态:
# 查看Ignite进程是否存在 ps aux | grep ignite # 查看节点启动日志,确认绑定地址是否正确 tail -f /path/to/ignite/logs/ignite.log
若节点未启动,排查主服务的Ignite依赖完整性、配置文件语法错误。
5. 添加超时配置(按报错提示)
为避免网络问题导致无限等待,配置ComputeTask和缓存事务超时:
<!-- 设置计算任务超时(30秒) --> <property name="computeTaskTimeout" value="30000"/> <!-- 设置缓存事务超时(60秒) --> <property name="transactionConfiguration"> <bean class="org.apache.ignite.configuration.TransactionConfiguration"> <property name="defaultTimeout" value="60000"/> </bean> </property>
内容的提问来源于stack exchange,提问作者Ritvik Rohatgi
相关产品推荐
相关产品推荐

