Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while accessing DAX aws from localhost client

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", "[email protected]"));
    System.out.println(fa);

}
like image 497
user3187171 Avatar asked Mar 04 '26 07:03

user3187171


1 Answers

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

like image 183
Joseph Idziorek Avatar answered Mar 07 '26 15:03

Joseph Idziorek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!