【问题标题】:Can't connect to Apache Ignite Cluster on AWS EC2 - Ignite server rejects clients无法连接到 AWS EC2 上的 Apache Ignite 集群 - Ignite 服务器拒绝客户端
【发布时间】:2019-05-12 10:40:52
【问题描述】:

我在连接到 Ignite 集群时遇到问题。我在 AWS EC2 上有 2 个节点,我使用基于 AWS S3 的发现。 Ignites 节点启动时没有错误,我看到启动 Ignite 后新对象如何出现在 S3 存储桶中。 在 AWS 安全组中,我打开了所有 TCP 端口,以便任何人都可以连接到集群。

但是当我尝试从我的计算机连接时出现org.apache.ignite.client.ClientConnectionException: Ignite cluster is unavailable 异常(我尝试从 IDE 运行简单的 JUnit 测试)。

我使用了以下配置:

    <property name="addressResolver">
        <bean class="org.apache.ignite.configuration.BasicAddressResolver">
            <constructor-arg>
                <map>
                    <entry key="EC2 internal IP" value="EC2 public ip"/>
                </map>
            </constructor-arg>
        </bean>
    </property>

    <property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">
                    <property name="awsCredentials" ref="reference to another bean with aws creds"/>
                    <property name="bucketName" value="MY_BUCKET_NAME"/>
                </bean>
            </property>
        </bean>
    </property>

这里的问题是服务器拒绝任何连接尝试,因为当我启动 Ignite 客户端(不是瘦客户端)时,我在日志中看到以下图片:

如您所见,客户端的数量等于 0 然后 1、0 和 1 等等。 所以我想,客户端可以到达集群,但是为什么他们被拒绝了?

【问题讨论】:

    标签: java amazon-web-services amazon-ec2 ignite


    【解决方案1】:

    我解决了这个问题。似乎有一条规则:如果您在 Ignite 集群中使用基于 AWS S3 的发现,那么您的 Ignite 客户端节点也应该使用相同的方法。这对我来说并不明显。

    根据official documentation

    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    
    BasicAWSCredentials creds = new BasicAWSCredentials("yourAccessKey", "yourSecreteKey");
    
    TcpDiscoveryS3IpFinder ipFinder = new TcpDiscoveryS3IpFinder();
    ipFinder.setAwsCredentials(creds);
    ipFinder.setBucketName("yourBucketName");
    

    【讨论】:

      猜你喜欢
      • 2021-05-23
      • 1970-01-01
      • 2018-10-05
      • 2020-02-14
      • 1970-01-01
      • 2021-02-05
      • 2021-10-04
      • 1970-01-01
      • 2018-02-10
      相关资源
      最近更新 更多