Meteor部署:mupx设置和mupx部署错误

时间:2017-03-08 18:37:08

标签: linux meteor amazon-ec2

在Aws EC2 Linux服务器上安装Meteor App。 我在mupx设置和mupx部署时遇到错误,如下所示。

在mup.json文件中,当" setupMongo":为true时,我收到此错误。

**Started TaskList: Setup (linux)**
[52.33.176.16] - Installing Docker
[52.33.176.16] - Installing Docker: SUCCESS
[52.33.176.16] - Setting up Environment
[52.33.176.16] - Setting up Environment: SUCCESS
[52.33.176.16] - Copying MongoDB configuration
**[52.33.176.16] x Copying MongoDB configuration: FAILED
        Received exit code 0 while establishing SFTP session**

当我设置" setupMongo":false时,mupx setup命令可以正常工作。

Started TaskList: Setup (linux)
[52.33.176.16] - Installing Docker
[52.33.176.16] - Installing Docker: SUCCESS
[52.33.176.16] - Setting up Environment
[52.33.176.16] - Setting up Environment: SUCCESS

问题1:当" setupMongo":是真的时,mupx设置肯定有什么问题?

在mupx设置正常后,我尝试了mupx deploy命令。我收到了这个错误。

Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Configuration file : mup.json
Settings file      : settings.json

“ Checkout Kadira!
  It's the best way to monitor performance of your app.
  Visit: https://kadira.io/mup ”

Meteor app path    : /var/www/html/meteor/test
Using buildOptions : {}
events.js:161
      throw er; // Unhandled 'error' event
      ^

Error: spawn meteor ENOENT
    at exports._errnoException (util.js:1028:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:422:7)
    at startup (bootstrap_node.js:143:9)
    at bootstrap_node.js:537:3

以下是重要的事情要知道

节点版本:v7.6.0 npm版本:v4.1.2

mup.json文件

{
  // Server authentication info
  "servers": [
    {
      "host": "52.33.176.16",
      "username": "root",
      //"password": "password",
      // or pem file (ssh based authentication)
      // WARNING: Keys protected by a passphrase are not supported
      "pem": "~/.ssh/myPrivateKeyFile.pem",
      // Also, for non-standard ssh port use this
      //"sshOptions": { "port" : 49154 },
      // server specific environment variables
      "env": {}
    }
  ],

  // Install MongoDB on the server. Does not destroy the local MongoDB on future setups
  "setupMongo": false,

  // Application name (no spaces).
  "appName": "test",

  // Location of app (local directory). This can reference '~' as the users home directory.
  // i.e., "app": "~/Meteor/my-app",
  // This is the same as the line below.
  "app": "/var/www/html/meteor/test",

  // Configure environment
  // ROOT_URL must be set to your correct domain (https or http)
  "env": {
    "PORT": 3000,
    "ROOT_URL": "http://musissive.com"
  },

  // Meteor Up checks if the app comes online just after the deployment.
  // Before mup checks that, it will wait for the number of seconds configured below.
  "deployCheckWaitTime": 15,

  // show a progress bar while uploading.
  // Make it false when you deploy using a CI box.
  "enableUploadProgressBar": true
  // Make it false when you deploy using a CI box.
  "enableUploadProgressBar": true
}

问题2:这个错误是什么?我试图将meteor提供的一个简单的流星应用程序作为默认应用程序。

1 个答案:

答案 0 :(得分:0)

尝试muphttps://github.com/zodern/meteor-up)而不是mupx 您可以使用此配置部署:

module.exports = {
  servers: {
    one: {
      host: '111.111.111.111',
      username: 'root',
      pem: "/home/user/.ssh/id_rsa",
      // password:
      // or leave blank for authenticate from ssh-agent
      // opts: {
      //     port: 22,
      // },
    }
  },

  meteor: {
    name: 'projectname',
    path: '/home/user/project-dir',
    docker: {
      image:'abernix/meteord:base', // of Meteor 1.4 +
    },
    servers: {
      one: {},
    },
    buildOptions: {
      serverOnly: true,
    },
    env: {
      ROOT_URL: 'http://yourdomain.com/', 
      MONGO_URL: 'mongodb://localhost/meteor',
    },

    deployCheckWaitTime: 60 //default 10
  },

  mongo: { 
    oplog: true,
    servers: {
      one: {},
    },
  },
};