gpt4 book ai didi

amazon-web-services - 从本地主机客户端访问 DAX aws 时出错

转载 作者:行者123 更新时间:2023-12-01 23:39:51 24 4
gpt4 key购买 nike

从本地主机客户端访问 DAX AWS 时出错

错误:

EVERE:在集群刷新期间捕获异常:java.io.IOException:无法从主机配置集群端点:[daxcluster*:8111]java.io.IOException:无法从主机配置集群端点:

示例测试代码

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);

}

最佳答案

DAX 集群在您的 VPC 中运行。要从您的笔记本电脑连接到 DAX 集群,您需要通过 VPN 连接到您的 VPC:http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpn-connections.html

关于amazon-web-services - 从本地主机客户端访问 DAX aws 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45143165/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com