简体   繁体   English

使用Mup在AWS EC2上部署Meteor App。 浏览器返回:“花了太长时间无法响应”

[英]Deploying Meteor App on AWS EC2 using mup. Browser returns: 'took too long to respond'

I'm trying to deploy a Meteor app using mup and an AWS EC2 micro instance. 我正在尝试使用Mup和AWS EC2微型实例部署Meteor应用程序。

I've followed the whole tutorial here http://www.curtismlarson.com/blog/2015/11/03/deploy-meteor-to-aws/ , successfully running mup deploy . 我已经在http://www.curtismlarson.com/blog/2015/11/03/deploy-meteor-to-aws/上关注了整个教程,成功运行了mup deploy

However when I go to the instance's Public IP on google chrome or firefox, it simply says: 但是,当我在google chrome或firefox上转到实例的公共IP时,它只是说:

myapp.com took too long to respond. myapp.com花了很长时间才响应。

If anyone could tell me how I can find the source of this problem, I'd be extremely grateful! 如果有人能告诉我如何找到此问题的根源,我将万分感谢!

Here's my mup.json : 这是我的mup.json

{
  // Server authentication info
  "servers": [
    {
      "host": "52.***.***.***",
      "username": "ubuntu",
      "pem": "~/************.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.36 by default. Do not use v, only version number.
  "nodeVersion": "0.10.41",

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

  // Show a progress bar during the upload of the bundle to the server.
  // Might cause an error in some rare cases if set to true, for instance in Shippable CI
  "enableUploadProgressBar": true,

  // Application name (No spaces)
  "appName": "menus",

  // Location of app (local directory)
  "app": "~/menus",

  // Configure environment
  "env": {
    "ROOT_URL": "http://myapp.com"
  },

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

The "ROOT_URL": "http://myapp.com" line is exactly how it appears in the file ( I didn't know what else to choose). "ROOT_URL": "http://myapp.com"行正是它在文件中的显示方式(我不知道该选择什么)。

Edit: Here's the /opt/menus/config/env.sh file: 编辑:这是/opt/menus/config/env.sh文件:

#!/bin/bash
export PORT=80
export MONGO_URL=mongodb://127.0.0.1/menus
export ROOT_URL=http://localhost

#it is possible to override above env-vars from the user-provided values

  export PORT=\8\0

  export ROOT_URL=\h\t\t\p\:\/\/\m\y\a\p\p\.\c\o\m

  export METEOR_SETTINGS=\{\"\p\u\b\l\i\c\"\:\{\}\}

  export CLUSTER_ENDPOINT_URL=\h\t\t\p\:\/\/\5\2\.\2\0\1\.\2\1\2\.\1\4\2\:\8\0

Those escapes definitely look out of place, but I feel like 1 wrong stroke could leave it still crashing! 那些逃生肯定看起来不合适,但是我觉得1个错误的中风可能会使它仍然崩溃! The fact that ROOT_URL is defined twice is concerning me. 关于ROOT_URL定义了两次的事实与我有关。 How exactly should I proceed? 我应该如何进行?

For me mup still has a bug where the file /opt/myapp/config/env.sh generated by mup was incorrectly formatted (there were some extra spaces and extra escapes). 对我来说, mup仍然有该文件中的错误/opt/myapp/config/env.sh所产生的mup格式不正确(有一些额外的空间和额外的逃逸)。 You may want to check that, ie, ssh into your instance and look at that file. 您可能需要检查一下,例如,将ssh插入实例并查看该文件。 If you need to fix it, do so, and then run mup restart from your development machine. 如果需要修复,请执行此操作,然后从开发计算机上运行mup restart

The second hypothesis I have is that mup doesn't interpret ~ . 我的第二个假设是mup不能解释~ So you may want to try using the resolved path for app , or just the relative path from where your mup.json lives. 因此,您可能想尝试使用app的解析路径,或仅使用mup.json所在位置的相对路径。

Update: 更新:

As expected, the env.sh file is wrong (bug in mup). 不出所料,env.sh文件错误(mup中的错误)。 Try this: 尝试这个:

#!/bin/bash
export PORT=80
export MONGO_URL=mongodb://127.0.0.1/menus
export ROOT_URL=http://localhost

#it is possible to override above env-vars from the user-provided values

export PORT=80
export ROOT_URL="http://myapp.com"
export METEOR_SETTINGS="{\"public\":{}}"
export CLUSTER_ENDPOINT_URL="http://52.201.212.142:80"

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

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