【问题标题】:Configuring Meteor deployment to Google Compute Engine VM using mupx使用 mupx 将 Meteor 部署配置到 Google Compute Engine VM
【发布时间】:2016-01-01 23:44:26
【问题描述】:

虽然我尝试了几种解决 SO 相关问题的方法,但在将 Meteor 项目部署到 Google Compute Engine 上的 VM 时,似乎没有任何方法可以解决我的问题。

我设置mupx 来处理部署,运行时没有任何明显问题

sudo mupx deploy

我的mup.json如下

{
  // Server authentication info
  "servers": [
    {
      "host": "104.199.141.232",
      "username": "simonlayfield",
      "password": "xxxxxxxx"
      // 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,

  // 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": "simonlayfield",

  // Location of app (local directory)
  "app": ".",

  // Configure environment
  "env": {
    "ROOT_URL": "http://simonlayfield.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": 30
}

在浏览器中导航到我的外部 IP 时,我可以看到 Meteor 站点模板,但是 Mongodb 数据没有显示。

http://simonlayfield.com

我已在 VM 上设置防火墙规则以允许流量通过端口 27017

Name: mongodb
Description: Allow port 27017 access to http-server
Network: default
Source filter: Allow from any source (0.0.0.0/0)
Allowed protocols and ports: tcp:27017
Target tags: http-server

我也尝试过传递 env 变量 MONGO_URL,但在几次尝试失败后,我在 Meteor 论坛上找到了 this post,这表明在使用本地 Mongodb 数据库时不需要它。

我目前使用 ssh 而不是 gcloud SDK 连接到 VM,但如果它有助于解决方案,我很乐意设置它。

如果有人能就我如何具体知道出了什么问题提供一些指导,我将不胜感激。我设置的防火墙规则是否足够?在专门使用 Google Compute Engine VM 时,是否还需要考虑其他因素?有没有办法让我通过 ssh 检查服务器上的日志,以便更清楚地了解连接/防火墙/配置问题?

我在这方面的知识有限,如果有一个简单的解决方法让我回避了,我深表歉意。

提前致谢。

【问题讨论】:

  • 更新:在浏览器控制台中检查我可以看到有一个 ws://simonlayfield.com/sockjs/612/6dozasr9/websocket 的 url 请求,该请求处于“待处理”状态。我假设这是相关的。
  • 你用什么密码?我认为 GCE 不允许通过用户名/密码进行用户身份验证?

标签: mongodb meteor ssh google-compute-engine


【解决方案1】:

最近有一些流星更新,请重新运行您的部署

另外附注:我总是为 mup / mupx 文件指定一个端口

"env": {
    "PORT": 5050,
    "ROOT_URL": "http://youripaddress"
  },

【讨论】:

  • 嗯。谢谢。我指定了"PORT": 80,并通过 ssh 重新启动了 docker。不幸的是,这似乎并没有解决问题......
猜你喜欢
  • 2016-03-25
  • 1970-01-01
  • 2020-01-15
  • 2017-09-29
  • 2017-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多