Is it possible to create a remote server with Mongodb? How?

Asked

Viewed 1,536 times

4

My question, to be clear, is to create a server with mongodb in a cloud hosting (for example) and access it through another server.

Example: I have a mobile app. I hosted my mongoDB in a cloud hosting (Ubuntu). I want to connect my app to db on the cloud server.

Is this possible? In what way?

I’m getting into this learning and my question was just create a server with Mongodb in a way that I could access it remotely. Outside of "localhost," you know? Unlike all the tutorials I’ve seen.

1 answer

3


Disregarding the issues of firewall and security, the logic for the remote connection of a Mongodb to a Mysql, for example, is the same.

In your terminal, in turn, you will use the following fragment to make the connection:

./mongo 192.168.0.1:27017

If the server IP or address is available and within the compliant, the connection will be made successfully.

In other words, you will raise the database in your cloud that is running fantastically on the IP 195.198.5.10. So, to access this "driver", you only need to point the access to 195.198.5.10. For example:

./mongo 195.198.5.10

Technically speaking, if you have an application, you will use this IP address to indicate where the bank is located.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.