简体   繁体   English

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

[英]Unable to execute HTTP request: Connect to localhost:8000 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

I'm trying to install dynamodb locally for docker .我试图安装dynamodb本地的码头工人

I've written the below code from here .我已经从这里编写了以下代码。

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

Then I can reach localhost:8000/shell然后我就可以访问localhost:8000/shell

In my client java , I set the endpoint在我的客户端java 中,我设置了端点

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

but when I run it, log the following error.但是当我运行它时,记录以下错误。

Can anyone help me?谁能帮我? enter code here在此处输入代码

Replace your endpoint configuration from:从以下位置替换您的端点配置:

http://localhost:8000

To:到:

http://host.docker.internal:8000

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HttpHostConnectException:连接到 localhost:2375 [localhost/127.0.0.1] 失败:连接被拒绝 - HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1] failed: Connection refused TestRestTemplate HttpHostConnectException:连接到本地主机:8082 [localhost/127.0.0.1] 失败:连接被拒绝 - TestRestTemplate HttpHostConnectException: Connect to localhost:8082 [localhost/127.0.0.1] failed: Connection refused java.net.ConnectException:无法连接到 localhost/127.0.0.1(端口 80):连接失败:ECONNREFUSED(连接被拒绝) - java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 80): connect failed: ECONNREFUSED (Connection refused) 无法连接到服务器:localhost / 127.0.0.1:9000:尝试一次失败。 java.net.ConnectException:连接被拒绝 - Failed to connect to server: localhost/127.0.0.1:9000: try once and fail. java.net.ConnectException: Connection refused RMI连接被拒绝与本地主机 - Rmi connection refused with localhost RMI连接在本地主机上被拒绝 - RMI connection refused on localhost 本地主机连接在springboot中被拒绝 - localhost connection refused in springboot 如何修复“nodetool:无法连接到'localhost:7199' - ConnectException:'连接被拒绝(连接被拒绝)'。” - how to fix “nodetool: Failed to connect to 'localhost:7199' - ConnectException: 'Connection refused (Connection refused)'.” 为什么拒绝连接到localhost? - Why connection to localhost is refused? Appium:连接到127.0.0.1:4723 [/127.0.0.1]失败:连接被拒绝:connect - Appium: Connect to 127.0.0.1:4723 [/127.0.0.1] failed: Connection refused: connect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM