Amazon DAX客户端抛出“无可用终端”例外 [英] Amazon DAX client throws "No endpoints available" exception

查看:175
本文介绍了Amazon DAX客户端抛出“无可用终端”例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码从本地主机连接到DAX:

I am trying to connect to DAX from a localhost using the following code:

    ClientConfig daxConfig = new ClientConfig()
            .withEndpoints("dax-cluster.yhdqu5.clustercfg.dax.use1.cache.amazonaws.com:8111");
    AmazonDaxClient client = new ClusterDaxClient(daxConfig);

集群已启动并正在运行,我已在公共子网中创建了该集群,并在其中打开了端口8111安全组,但是尽管如此,我仍然收到以下异常:

The cluster is up and running, I've created it in a public subnet and opened port 8111 in the security group, but despite this I receive the following exception:

Caused by: java.io.IOException: No endpoints available
    at com.amazon.dax.client.cluster.Cluster.leaderClient(Cluster.java:560)
    at com.amazon.dax.client.dynamodbv2.ClusterDaxClient$3.getClient(ClusterDaxClient.java:154)
    at com.amazon.dax.client.dynamodbv2.ClusterDaxClient$RetryHandler.makeRequestWithRetries(ClusterDaxClient.java:632)
    ... 10 more
    Suppressed: java.io.IOException: No endpoints available
        ... 13 more
        Suppressed: java.io.IOException: No endpoints available
            ... 13 more

关于StackOverflow的其他答案表明,这可能是由于配置错误的安全组引起的,为了对其进行测试,我在同一VPC /子网中启动了一个实例,使用了相同的安全组,因此我可以ssh到该主机(安全组中同时打开了22nd和8111st端口)。因此,应该还有其他与DAX相关的原因。

Other answers on StackOverflow suggest that this may be caused by incorrectly configured security group and to test it I've launched an instance in the same VPC/subnet and used the same security group and I was able to ssh to this host (both 22nd and 8111-st ports are opened in the security group). So there should be some other DAX related reason.

我的计算机上的防火墙已关闭。

The firewall on my machine is turned off.

但是如果我在EC2中使用SSH,则可以连接到DAX群集:

But if I ssh to a machine in EC2, then I can connect to the DAX cluster:

[ec2-user@ip-10-0-0-44 ~]$ nc -z dax-cluster.yhdqu5.clustercfg.dax.use1.cache.amazonaws.com 8111
Connection to dax-cluster.yhdqu5.clustercfg.dax.use1.cache.amazonaws.com 8111 port [tcp/*] succeeded!


推荐答案

您只能通过以下方式从EC2计算机连接到DAX:与DAX群集相同的VPC。除非您的本地主机是同一VPC中的EC2实例,否则它将无法连接到DAX群集。

You can only connect to DAX from an EC2 machine in the same VPC as the DAX cluster. Unless your localhost is an EC2 instance in the same VPC, it won't be able to connect to the DAX cluster.

这篇关于Amazon DAX客户端抛出“无可用终端”例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆