Restore Mongodb on a meteor production server

I am trying to copy all the data from my meteor mongo default localhost database to a production server to use it in "app.meteor.com".

I tried using mongorestore using the information provided by "meteor mongo --url app.meteor.com", but it does not modify any document. Moreover, when I connect to the mongo server database, I can only read (find) documents. When I use the update or insert functions, it says "not master"

+3
mongodb meteor
Feb 04 '13 at 13:05
source share
2 answers

Run ~ / meteor / meteorite mongo -U yoapp

You will get something like this

mongodb://client:387shff-fe52-07d4-69a4-ba321f3665fe7@c0.meteor.m0.mongolayer.com:27017/yoapp_meteor_com 

Take values ​​and type in mongorestore like this

 mongorestore -u client -p 387shff-fe52-07d4-69a4-ba321f3665fe7 -h c0.meteor.m0.mongolayer.com:27017 -db yoapp_meteor_com /home/user/dump/yoapp 

I just dropped the prod application on my local dev machine. Checking for some new changes. He pushed the code into an intermediate installation on meteor.com, and then used mongorestore to populate the intermediate database.

+6
Apr 07 '13 at
source share

In addition, when I connect to the mongo server database, I can only read (find) documents. When I use the update or insert functions, it says "not master"

Probably because the server you are connecting to is not MASTER, but SLAVE in the replica set. Slaves are read only, and all records must be sent to the master. You can get the hostname: port by rs.conf() and looking at the entries in members . See http://docs.mongodb.org/manual/reference/replica-configuration/

Get a master, and then try mongoimport / mongorestore on it.

You should also loop the mongod logs on your production server to see if there are any errors during the import (assuming you have access).

0
Feb 04 '13 at 13:21
source share



All Articles