Is it possible to create a remote server with MongoDB? In what way?

4

My question, to be clearer, 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 joining this learning and my question was just creating a server with MongoDB in a way that I could access it remotely. Out of localhost, you know? Unlike all the tutorials I've seen.

    
asked by anonymous 24.04.2014 / 13:29

1 answer

3

Regardless of firewall and security issues, the logic for remotely connecting a MongoDB to a MySQL, for example, is the same.

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

./mongo 192.168.0.1:27017

If the IP address or the server address is available and within the conform, the connection will be successful.

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

./mongo 195.198.5.10

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

    
24.04.2014 / 14:52