简体   繁体   English

在AWS中连接到DAX时出错

[英]Error when connecting to DAX in AWS

we're having trouble connecting to DAX from a java application in our test environment. 我们在测试环境中从java应用程序连接到DAX时遇到问题。 The DAX cluster and configuration are done in our cloudformation template for our test env. DAX集群和配置在我们的测试环境的cloudformation模板中完成。

These are the errors in the trace: 这些是跟踪中的错误:

[ERROR] DaxClient-39: caught exception during cluster refresh: java.io.IOException: failed to configure cluster endpoints from hosts [ERROR] DaxClient-39:在群集刷新期间捕获到异常:java.io.IOException:无法从主机配置群集端点

Suppressed: com.amazon.dax.client.exceptions.DaxServiceException: [XXXX.XX] Connection requires authentication (Service: null; Status Code: -1; Error Code: null; Request ID: null) 禁止:com.amazon.dax.client.exceptions.DaxServiceException:[XXXX.XX]连接需要身份验证(服务:null;状态代码:-1;错误代码:null;请求ID:null)

We use the same template in our dev environment and are able to connect to DAX in that environment from ec2 instances in that env. 我们在开发环境中使用相同的模板,并且能够从该环境中的ec2实例连接到该环境中的DAX。

We have verified connectivity to the cluster using: 我们使用以下方法验证了与群集的连接:

nc -z v-dax-test.3fxxxx.clustercfg.dax.usw2.cache.amazonaws.com 8111 nc -z v-dax-test.3fxxxx.clustercfg.dax.usw2.cache.amazonaws.com 8111

and can run 并且可以运行

aws dax describe-clusters --r us-west-2 aws dax describe-clusters --r us-west-2

on the ec2 instance that is trying to connect to DAX and get back results that seem sane. 试图连接到DAX的ec2实例并获得看似合理的结果。

The instance is running a java application using the aws java sdk and the dax client lib. 该实例使用aws java sdk和dax客户端lib运行java应用程序。

We've verified that DAX's security group allows incoming connections from 8111 from the security group the ec2 instance is in. 我们已经验证了DAX的安全组允许来自ec2实例所在安全组的8111的传入连接。

The dax subnet group specifies the subnets which the ec2 instance is in. dax子网组指定ec2实例所在的子网。

Can anyone tell me what this error means, and how to resolve it? 任何人都可以告诉我这个错误意味着什么,以及如何解决它?

Thank you! 谢谢!

This could be occurring if you haven't specified the region when instantiating the DAX ClientConfig and accessing a DAX cluster in in a region other than us-east-1 (the clients default region). 如果在实例化DAX ClientConfig并在us-east-1(客户端默认区域)以外的区域中访问DAX群集时未指定区域,则可能会发生这种情况。 To specify the region try: 要指定区域,请尝试:

ClientConfig daxConfig = new ClientConfig()
    .withEndpoints(daxEndpoint).withRegion("us-west-2");
AmazonDaxClient client = new ClusterDaxClient(daxConfig);

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

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