简体   繁体   English

使用MUP将Meteor应用程序部署到Ubuntu EC2实例

[英]Deploying Meteor application with MUP to Ubuntu EC2 instance

Versions/Background 版本/背景

I'm using version 0.7.6 of meteor-up (mup), Meteor 1.0.2.1 which uses Mongo v0.10.33 from what I've read. 我正在使用流星(mup)的0.7.6版本,流星1.0.2.1,它使用了我所读到的Mongo v0.10.33。

I'm using a small Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-3d50120d EC2 instance on AWS as a destination for my Meteor application. 我在AWS上使用小型Ubuntu Server 14.04 LTS(HVM),SSD卷类型ami-3d50120d EC2实例作为Meteor应用程序的目标。

My domain is pointing at the ami-3d50120d instance's Elastic IP (I'll call it domain-name here). 我的域指向ami-3d50120d实例的弹性IP(在这里我将其称为domain-name )。

I'm able to do mup setup on the new ami-3d50120d where I install Mongo and Node successfully, with an output that looks like so: 我能够做的mup setup在新的ami-3d50120d ,我安装蒙戈和节点成功,有看起来像这样的输出:

[domain-name.com] - Installing Node.js
[domain-name.com] ✔ Installing Node.js: SUCCESS
[domain-name.com] - Setting up Environment
[domain-name.com] ✔ Setting up Environment: SUCCESS
[domain-name.com] - Copying MongoDB configuration
[domain-name.com] ✔ Copying MongoDB configuration: SUCCESS
[domain-name.com] - Installing MongoDB
[domain-name.com] ✔ Installing MongoDB: SUCCESS
[domain-name.com] - Configuring upstart
[domain-name.com] ✔ Configuring upstart: SUCCESS

Steps to recreate Error Condition 重新创建错误条件的步骤

  1. created a new Ubuntu instance 创建了一个新的Ubuntu实例
  2. assigned the Elastic IP that's linked to my domain 分配了链接到我的域的弹性IP
  3. configured my mup.json file (will detail below) 配置了我的mup.json文件(将在下面详细介绍)
  4. did a mup setup -> everything installed successfully 完成了Mup设置->一切都成功安装
  5. ssh'd into my instanced and did a node -v -> v0.10.33 ssh'd到我的实例中,并做了一个node -v -v-> v0.10.33
  6. back on my OSX box -> did a node -v -> v0.10.32 回到我的OSX盒子上->做一个node -v -v-> v0.10.32
  7. did a mup deploy -> error condition occurs 进行过Mup部署->发生错误情况

Error condition 错误情况

[domain-name.com] - Uploading bundle
[domain-name.com] ✔ Uploading bundle: SUCCESS
[domain-name.com] - Setting up Environment Variables
[domain-name.com] ✔ Setting up Environment Variables: SUCCESS
[domain-name.com] - Invoking deployment process
✘ Invoking deployment process: FAILED


-------STDERR----
Warning: Permanently added 'domain-name.com,55.555.5.555' (RSA) to the list of known hosts. sudo: node-gyp: command not found
-------STDOUT-----
=> re-installing binary npm module 'bcrypt' of package 'npm-bcrypt'

Note 注意

I guess I have node v0.10.32 installed on my OSX box (and node v0.10.33 installed on my amazon instance), but this shouldn't affect my node version for Meteor version 1.2.1, as it has its own version of node as far as I know. 我想我在OSX盒子上安装了节点v0.10.32(在我的Amazon实例上安装了节点v0.10.33),但这不会影响流星版本1.2.1的节点版本,因为它具有自己的节点版本我所知道的。

mup Configuration 模板配置

My mup.json, where domain-name.com is pointing to my Elastic IP assigned to the instance, looks like so: 我的mup.json( domain-name.com指向我分配给实例的弹性IP)看起来像这样:

{
  // Server authentication info
  "servers": [
    {
      "host": "domain-name.com",
      "username": "ubuntu",
      // or pem file (ssh based authentication)
      "pem": "/Users/user-name/Meteor/pem-file-name.pem"
    }
  ],

  // 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.33 by default. Do not use v, only version number.
  "nodeVersion": "0.10.33",

  // Install PhantomJS in the server
  "setupPhantom": false,

  // Application name (No spaces)
  "appName": "application-name",

  // Location of app (local directory)
  "app": "/Users/user-name/Meteor/application-name",

  // Configure environment
  "env": {
    "PORT": 80,
    "ROOT_URL": "http://domain-name.com",
    "MONGO_URL": "mongodb://localhost:27017/clients-database"
  },

  // 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": 30
}

In my case the solution was two fold. 就我而言,解决方案有两个方面。 Again, I'm using a small Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-3d50120d EC2 instance. 同样,我使用的是小型Ubuntu Server 14.04 LTS(HVM),SSD卷类型-ami-3d50120d EC2实例。


First that I installed node version 0.10.35, instead of 0.10.33 using mup. 首先,我使用mup安装了节点版本0.10.35,而不是0.10.33。

I was under the impression from https://github.com/meteor/meteor/blob/devel/History.md#upgraded-dependencies that node: 0.10.33 (from 0.10.29) was used by Meteor v1.0.2, 2014-Dec-19. 我对https://github.com/meteor/meteor/blob/devel/History.md#upgraded-dependencies的印象是,流星v1.0.2使用了节点0.10.33(来自0.10.29),2014年 - 癸19。


Second I changed my inbound/outbound rules on my AWS Security group. 其次,我在AWS安全组上更改了入站/出站规则。 The only thing I added was HTTP inbound and all traffic outbound types. 我添加的唯一一件事是HTTP入站和所有流量出站类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM