首页 文章

Apache Ignite Server到客户端连接问题

提问于
浏览
0

我在AWS EC2实例上安装了Apache Ignite服务器 . 我正在使用s3存储桶进行客户端发现 . 我在docker容器中部署了多个微服务,并且它们正在与Ignite服务器通信 . 我遇到的问题是,当我的微服务将自己注册到Ignite服务器作为客户端时,它工作得非常好 . 它正在注册Docker容器专用IP范围,Ignite服务器无法访问它 . 现在,当Ignite服务器检查客户端心跳时,它无法访问 . 有人可以告诉我们使用基于容器的架构进行点火的最佳方法 .

enter image description here

输出:服务器尝试检查客户端状态

(wrn) <visor>: 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=8b04f5a6-6b1d-498b-98b2-1044b8c25f3a,
 addrs=[/172.17.0.4:47100, /127.0.0.1:47100]]

2 回答

  • 0

    1)让我们知道你的EC2 ip的地址

    TcpDiscoverySpi spi = //whatever
    spi.setLocalAddress( /* ip on ec2 subnet */ );
    

    2)在“主机”网络模式下运行docker,而不是默认的“桥接”模式

    这两个步骤应允许Ignite群集成员之间的双向TCP握手

  • 0

    您可以通过ignite配置中的系统环境变量将主机名转发到ignite容器:

    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
        <property name="addresses">
            <list>
                <value>#{systemEnvironment['IGNITE_HOST'] ?: '127.0.0.1'}:47500..47509</value>
            </list>
        </property>
    </bean>
    

    docker-compose.yml 为2传达点火服务的示例:

    version: "3"
    services:
      ignite:
        image: image_name1
        networks:
          - net
      face:
        image: image_name2
        depends_on:
          - ignite
        networks:
          - net
        environment:
          IGNITE_HOST: 'ignite'
    

    'face'的点燃节点可以使用地址 ignite:47500..47509 连接到'ignite'的另一个点火节点

相关问题