【问题标题】:Meteor Deployment: mupx setup and mupx deploy errorsMeteor 部署:mupx 设置和 mupx 部署错误
【发布时间】:2017-03-10 02:58:10
【问题描述】:

在 Aws EC2 Linux 服务器上安装 Meteor 应用程序。 我在 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 设置命令可以像这样正常工作。

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": true 时 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:这个错误是关于什么的?我正在尝试将流星提供的简单流星应用程序作为默认应用程序。

【问题讨论】:

    标签: linux meteor amazon-ec2


    【解决方案1】:

    尝试mup (https://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: {},
        },
      },
    };
    

    【讨论】:

    • 感谢您的建议!我现在要使用mup。但是,我有一个关于 PEM 文件的问题。当我们设置 Amazon 服务器时,我们将密钥对 *.pem 文件下载到我们的本地计算机。我们是否需要将此文件上传到位于“~/.ssh”位置的 AWS EC2 服务器,然后在 mup 文件中给出该路径?
    • 我不了解 AWS EC2。 pem 是您的私钥的位置(默认情况下它将位于 ubuntu 的 ~/.ssh 文件夹中)。与此密钥对应的公钥应添加到您的 EC2 服务器上。
    • 我也在 ubuntu 服务器上尝试过 mup。如以下答案所述,我的 mup setup 命令运行良好。但是 mup deploy 失败了。可能有什么问题??真的很沮丧。
    • 请使用最新的mup.js 文件更新您的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-02
    • 1970-01-01
    • 2016-08-27
    • 2016-08-30
    相关资源
    最近更新 更多