Reputation: 6037
we're having trouble connecting to DAX from a java application in our test environment. The DAX cluster and configuration are done in our cloudformation template for our test env.
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
Suppressed: com.amazon.dax.client.exceptions.DaxServiceException: [X.X.XX.XX] Connection requires authentication (Service: null; Status Code: -1; Error Code: null; Request 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.
We have verified connectivity to the cluster using:
nc -z v-dax-test.3fxxxx.clustercfg.dax.usw2.cache.amazonaws.com 8111
and can run
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.
The instance is running a java application using the aws java sdk and the dax client lib.
We've verified that DAX's security group allows incoming connections from 8111 from the security group the ec2 instance is in.
The dax subnet group specifies the subnets which the ec2 instance is in.
Can anyone tell me what this error means, and how to resolve it?
Thank you!
Upvotes: 4
Views: 3538
Reputation: 711
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). To specify the region try:
ClientConfig daxConfig = new ClientConfig()
.withEndpoints(daxEndpoint).withRegion("us-west-2");
AmazonDaxClient client = new ClusterDaxClient(daxConfig);
Upvotes: 4