在meteor 生产服务器中恢复一个mongodb [英] Restore a mongodb in meteor production server

查看:14
本文介绍了在meteor 生产服务器中恢复一个mongodb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将所有数据从我的本地主机默认流星 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

我刚刚将一个 prod 应用程序转储到我的本地开发机器上.测试一些新的变化.将代码推送到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.

这篇关于在meteor 生产服务器中恢复一个mongodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆