Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a mongodb database data on my computer. I want to upload that into amazon.com server.

The bottle neck is the internet connection.

One way is to zip the file and then upload it to the server. But what about if after that I want to synchronize the server data with current data?

Another is to set the mongo in server as slave of the data in my computer. However, my computer is a home computer that connect to the internet via router. So how do the amazon server knows the IP of my computer? The IP is fe80::6df8:c5f9:bdb5:b9e2%15

It seems that it's the IPv6 IP. I do not know the IP4 IP.

So how do I turn a server in my computer to become master? How do I set the router to pass on connection?

Then there is mongodump. Is it fast?

Which one do you usually use?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

First, let me say that I would not recommend doing this, ever. I would recommend running your database on EC2 and having it live there, only. Have a test database on your local machine for convenience, but keeping the two in sync is going to be painful, as you will see from the answers below.

One way is to zip the file and then upload it to the server. But what about if after that I want to synchronize the server data with current data?

You either need to add that EC2 based server as a secondary, so that it syncs from your home machine (likely to be unreliable) and would require that you have an appropriate set up to route traffic), or you need to replay the oplog manually from your home machine on the EC2 machine (basically how replication functions). You can write your own program to do so, or in 2.2 you have the option of the mongooplog tool

So how do the amazon server knows the IP of my computer? So how do I turn a server in my computer to become master? How do I set the router to pass on connection?

It may not be able to route to your computer, you may have only an IPV6 address, but I doubt it. Go here:

http://www.whatsmyip.org/

That will tell you what your publicly viewable IP address is, and then you can try connecting to it from EC2 to see if it works. It may not - ISPs will often block listening ports and have other firewalls in effect to prevent this. As for how to pass on connections through a rotuer etc. that topic is large and beyond the scope of the DBA site realistically. You should try SuperUser for a detailed answer on that front, and be sure to include your router model when asking.

Then there is mongodump. Is it fast?

Mongodump is as fast as your database basically - it has to walk an index (usually _id), write out each document it finds as BSON. So it will be limited by how quickly your machine can do that. It is not likely to be as fast as a simple file based copy.

Which one do you usually use?

I doubt anyone runs in this manner for very long - it will be too prone to failure. I would imagine that most will do one of the above methods once (or at least very infrequently), to move their DB into EC2 or elsewhere on the cloud, then just use it there, rather than trying to keep the two in sync as part of a replica set.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.