簡體   English   中英

使用MUP進行流星部署,我的集合未部署

[英]Meteor deploy with MUP, my collections are not deployed

我使用流星創建我的應用程序,並使用MUP將其部署在我自己的服務器中。 部署成功,但是數據庫沒有我的館藏。

我在文件lib/collections/name_collection.js定義了集合。 這是文件的示例:

 campaigns = new Mongo.Collection("campaigns"); campaigns.initEasySearch(['name','startDate','endDate']); campaigns.newSchema=function(){ return new SimpleSchema({ name:{ type: String, label: 'Nome' }, startDate:{ type: 'datetime', label: 'Data inizio' }, endDate:{ type: 'datetime', label: 'Data fine' } }); }; campaigns.editSchema=function(){ return new SimpleSchema({ c_id:{ type: String, label: 'id' }, editName:{ type: String, label: 'Nome' }, editStartDate:{ type: 'datetime', label: 'Data inizio' }, editEndDate:{ type: 'datetime', label: 'Data fine' } }); }; SimpleSchema.messages({ "required name": "Il [label] è richiesto", "required startDate": "La [label] è richiesto", "required endDate": "La [label] è richiesto" }); campaigns.allow({ insert: function (userId, doc) { // the user must be logged in, and the document must be owned by the user return (userId && doc.user === userId); }, update: function (userId, doc, fields, modifier) { // can only change your own documents return doc.user === userId; }, remove: function (userId, doc) { // can only remove your own documents return doc.user === userId; }, fetch: ['user'] }); campaigns.deny({ update: function (userId, docs, fields, modifier) { // can't change owners return _.contains(fields, 'owner'); } }); 

和mup.json文件:

 { // Server authentication info "servers": [ { "host": "168.235.151.xxx", "username": "dvterritorg", // develop user "password": "xxxxxx" // or pem file (ssh based authentication) //"pem": "~/.ssh/id_rsa" } ], // Install MongoDB in the server, does not destroy local MongoDB on future setup "setupMongo": true, // WARNING: Node.js is required! Only skip if you already have Node.js installed on server. "setupNode": true, // WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number. "nodeVersion": "0.10.36", // Install PhantomJS in the server "setupPhantom": true, // Application name (No spaces) "appName": "dvterritorg", // Location of app (local directory) "app": ".", // Configure environment "env": { "ROOT_URL": "http://dv.xxxxxx.it", //"MONGO_URL": "mongodb://dvterritorg:xxxxxx@127.0.0.1/dvterritorg", "METEOR_ENV": "production" }, // Meteor Up checks if the app comes online just after the deployment // before mup checks that, it will wait for no. of seconds configured below "deployCheckWaitTime": 60 } 

我嘗試在meteor.com和compose.io中進行部署,但結果是相同的。

你能幫助我嗎?

這是預期的。 Mongo是NoSQL數據庫。 只要將數據插入其中,便會立即進行收集。 您的數據庫沒有數據,因此沒有集合。 對於任何mongo數據庫,例如通過mup deploy托管的那些meteor.com (如果您使用了compose或上面的腳本中的本地數據庫),情況也是如此。

如果您打算這樣做,則MUP或meteor deploy請勿上載本地數據庫的內容。 您必須使用mongodumpmongorestore自己執行此mongorestorehttps : mongorestore

您可以從mongodb.org獲取mongorestore和mongodump二進制文件

您可以轉儲本地數據庫(如果在端口3000上運行meteor-添加一個):

mongodump --port 3001

這將創建dump文件夾,您可以使用它使用mongorestore進行還原,這可能需要更多的身份驗證詳細信息,如上面compose.io文章中所述。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM