3

Getting Error while accessing DAX AWS from localhost client

Error:

EVERE: caught exception during cluster refresh: java.io.IOException: failed to configure cluster endpoints from hosts: [daxcluster*:8111] java.io.IOException: failed to configure cluster endpoints from hosts:

Sample test code

public static String clientEndPoint = "*.amazonaws.com:8111";

DynamoDB getDynamoDBClient() {
    System.out.println("Creating a DynamoDB client");
    AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard().withRegion(Regions.US_EAST_1).build();
    return new DynamoDB(client);
}
static DynamoDB getDaxClient(String daxEndpoint) {
    ClientConfig daxConfig = new ClientConfig().withEndpoints(daxEndpoint);
    daxConfig.setRegion(Regions.US_EAST_1.getName());
    AmazonDaxClient client = new ClusterDaxClient(daxConfig);
    DynamoDB docClient = new DynamoDB(client);
    return docClient;
}

public static void main(String args[]) {

    DynamoDB client = getDaxClient(clientEndPoint);
    Table table = client.getTable("dev.Users");
    Item fa = table.getItem(new GetItemSpec().withPrimaryKey("userid", "tf@gmail.com"));
    System.out.println(fa);

}
  • Are you trying to access DAX clusters from local? Can you show the code? – notionquest Jul 17 '17 at 11:48
  • @notionquest i have put the code in above post . – user3187171 Jul 17 '17 at 12:07
  • This may be helpful. https://stackoverflow.com/questions/44928457/getting-failed-to-configure-cluster-endpoints-error-when-using-dax-with-dynamodb. Please check whether the inbound traffic on TCP port 8111 has required privilege. – notionquest Jul 17 '17 at 12:44

2 Answers2

2

A DAX cluster runs within your VPC. To connect from your laptop to the DAX cluster, you need to VPN into your VPC: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpn-connections.html

Joseph Idziorek
  • 4,853
  • 6
  • 23
  • 37
2

Answer: DAX is only supported within VPC

I faced this same issue myself and found out the hard way.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.html

Usage Notes For a list of AWS regions where DAX is available, refer to https://aws.amazon.com/dynamodb/pricing.

DAX supports applications written in Java, Node.js, .Python and .NET, using AWS-provided clients for those programming languages.

DAX does not support Transport Layer Security (TLS).

DAX is only available for the EC2-VPC platform. (There is no support for the EC2-Classic platform.)

DAX clusters maintain metadata about the attribute names of items they store, and that metadata is maintained indefinitely (even after the item has expired or been evicted from the cache). Applications that use an unbounded number of attribute names can, over time, cause memory exhaustion in the DAX cluster. This limitation applies only to top-level attribute names, not nested attribute names. Examples of problematic top-level attribute names include timestamps, UUIDs, and session IDs.

Note that this limitation only applies to attribute names, not their values. Items like this are not a problem:

Charles
  • 450
  • 1
  • 4
  • 20