无法执行HTTP请求:连接到localhost:8000 [localhost / 127.0.0.1]失败:连接被拒绝(连接被拒绝)

时间:2019-05-09 13:29:10

标签: java amazon-web-services docker amazon-dynamodb amazon-dynamodb-local

我正在尝试为 docker 在本地安装dynamodb

我已经从here编写了以下代码。

docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedD

然后我可以联系localhost:8000/shell

在客户端 java 中,我设置了端点

AmazonDynamoDB client = AmazonDynamoDBClientBuilder
    .standard()
    .withCredentials(new EnvironmentVariableCredentialsProvider())
    .withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration("http://localhost:8000/", "eu-central-1")
    ).build();

但是当我运行它时,记录以下错误。

有人可以帮助我吗?在此处输入代码

1 个答案:

答案 0 :(得分:1)

从以下位置替换端点配置:

http://localhost:8000

收件人:

http://host.docker.internal:8000
相关问题