简体   繁体   中英

Remote MongoDB successful only when MongoDB is open on local

I have a Ubuntu VM in an EC2 AWS instance, with MongoDB installed. I can successfully save information to this database on my local machine using a spring boot application. However, this remote connection can only be made when I have a connection to remote Mongodb open on my local machine. Otherwise, the connection is refused.

My end goal is to have a mobile application that can preform CURD operations to a remote MongoDB.

Any help regarding this issue is appreciated.

Thanks.

You shouldn't be trying to connect to a remote MongoDB from a mobile application because anyone will be able to tamper with the information you are storing in it.

Consider using a local database bundled along with your mobile application or connecting from your mobile application to your Spring boot app which can then talk to the MongoDB instance.

Please check some point.

1: Please check remote connection open in your Mongo instance

2: Ec2 Instance have public accessibility

3: Ec2 Instance mongo port enabled and remotely accessible.

Did you confirm that the bind_ip actually changed to 0.0.0.0/0, ::/0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM