在流星生产服务器中还原mongodb [英] Restore a mongodb in meteor production server
问题描述
我正在尝试将所有数据从localhost默认的流星mongo数据库复制到生产服务器,以在"app.meteor.com"中使用它.
I'm trying to copy all the data from my localhost default meteor mongo database to the production server to use it in "app.meteor.com".
我尝试使用"meteor mongo --url app.meteor.com"提供的信息使用mongorestore,但它没有修改任何文档. 而且,当我连接到服务器的mongo数据库时,我只能读取(查找)文档.当我使用更新或插入功能时,它说不是主控"
I tried to use mongorestore usinng the information provided by "meteor mongo --url app.meteor.com", but it does not modify any document. Moreover, when I connect to mongo database of the server, I can only read (find) documents. When i use update or insert functions it says "not master"
推荐答案
运行 〜/meteor/meteor mongo -U yoapp
Run ~/meteor/meteor mongo -U yoapp
您会得到类似的东西
mongodb://client:387shff-fe52-07d4-69a4-ba321f3665fe7@c0.meteor.m0.mongolayer.com:27017/yoapp_meteor_com
采用这些值并将其放入mongorestore中
Take the values and put into 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
我刚将产品应用程序转储到本地开发机上.测试一些新的更改.将代码推送到meteor.com上的分段安装,然后使用mongorestore填充分段数据库.
I just dumped a prod app to my local dev machine. Testing some new changes. Pushed code to a staging install on meteor.com and then used mongorestore to populate the staging database.
这篇关于在流星生产服务器中还原mongodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!