Can't connect to local DynamoDb instance via AWS CLI

痴心易碎 提交于 2019-12-01 22:00:43

问题


I've created the local instance of DynamoDb by next steps: in Visual Studio I installed AWS explorer and create a new local instance on localhost:82. I can successfully work with it from my c# code using AWS library. I created the table and even put into it some data. I can even see that data in AWS explorer in Visual Studio. I need to add a lot of data, and I prepare to use AWS CLI tool. But I can't see any data and tables from the console. I put this :

aws dynamodb list-tables --endpoint-url http://localhost:82

and see in response that:

{
    "TableNames": []
}

But I am pretty sure that DB on that port has some data because I can achieve it from my c# code. I tried to launch DynamoDb from console by this command as well:

java -jar DynamoDBLocal.jar

It successfully launched but in that case, I can't achieve this server from my c# code.

Code from screenshot below works well and successfully put data into the table: On another hand, this is output from AWS CLI: Sorry, probably that's dumb questions, but what am I doing wrong ? Thanks.


回答1:


I had the exact same problem. Basically you need to specify -sharedDb when starting up dynamo

java -jar DynamoDBLocal.jar -sharedDb

I hope that solves your problem.




回答2:


java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

has resolved a similar problem.



来源:https://stackoverflow.com/questions/39439500/cant-connect-to-local-dynamodb-instance-via-aws-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!