简体   繁体   English

无法连接到AWS EC2上的Apache Ignite群集-Ignite服务器拒绝客户端

[英]Can't connect to Apache Ignite Cluster on AWS EC2 - Ignite server rejects clients

I have problems with connecting to my Ignite cluster. 我在连接到Ignite群集时遇到问题。 I have 2 nodes on AWS EC2 and I use AWS S3 based discovery. 我在AWS EC2上有2个节点,并且使用基于AWS S3的发现。 Ignites nodes start without errors and I see how new objects appear at S3 bucket after launching Ignite. Ignites节点启动时没有错误,我看到启动Ignite后新对象如何出现在S3存储桶中。 In AWS Securuty groups I opened all TCP ports so that it is expected that anyone can connect to the cluster. 在AWS Securuty组中,我打开了所有TCP端口,以便期望任何人都可以连接到集群。

But I get org.apache.ignite.client.ClientConnectionException: Ignite cluster is unavailable exception when I try to connect from my computer (I try to run simple JUnit tests from IDE). 但是我得到org.apache.ignite.client.ClientConnectionException: Ignite cluster is unavailable当我尝试从计算机连接时(我尝试从IDE运行简单的JUnit测试), org.apache.ignite.client.ClientConnectionException: Ignite cluster is unavailable异常。

I used the following configuration: 我使用以下配置:

    <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>

The problem here is that server rejects any attempts to connect, because when I start Ignite client (not Thin client) I see at logs the following picture: 这里的问题是服务器拒绝任何连接尝试,因为当我启动Ignite客户端(不是瘦客户端)时,我在日志中看到以下图片: 在此处输入图片说明

As you can see, the number of clients become equal to 0 then 1, 0 and 1 and etc. So I suppose, clients can reach the cluster, but why are they being rejected? 如您所见,客户端的数量等于0,然后等于1、0和1等等。因此,我想,客户端可以到达群集,但是为什么拒绝它们呢?

I solved this problem. 我解决了这个问题。 It seems there is a rule: If you use AWS S3 based discovery in your Ignite cluster, your Ignite client nodes should use the same approach as well. 似乎有一条规则:如果您在Ignite群集中使用基于AWS S3的发现,则Ignite客户端节点也应使用相同的方法。 It wasn't obvious for me. 这对我来说并不明显。

According to the official documentation : 根据官方文件

TcpDiscoverySpi spi = new TcpDiscoverySpi();

BasicAWSCredentials creds = new BasicAWSCredentials("yourAccessKey", "yourSecreteKey");

TcpDiscoveryS3IpFinder ipFinder = new TcpDiscoveryS3IpFinder();
ipFinder.setAwsCredentials(creds);
ipFinder.setBucketName("yourBucketName");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM