如何使用 mupx 和 MONGO_URL 在 ubuntu 上部署 meteor 应用程序?
How to deploy meteor app on ubuntu by using mupx with MONGO_URL?
我正在尝试使用 mupx 在 Ubuntu14.04/AWS 上部署 Meteor 应用程序。
这是我的环境。
服务器
节点:v5.10.0,
npm:3.8.9,
Ubuntu : 14.04
客户
节点:v5.5.0,
npm:3.8.8,
Mac:版本 10.11.014
mupx 设置 -> 一切正常。
mupx 部署 -> 验证部署:发生失败。
这是日志
-----------------------------------STDERR-----------------------------------
pm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
=> Starting meteor app on port:80
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
----------------------------------------------------------------------------
我做的时候 "mupx logs --tail=50"
我得到了...
------------------------------------------------
Configuration file : mup.json
Settings file : settings.json
[52.39.5.187] => Starting meteor app on port:80
[52.39.5.187] npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
/bundle/bundle/programs/server/node_modules/fibers/future.js:300
throw(ex);
^
[object Object]
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
[52.39.5.187] npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
[52.39.5.187] => Starting meteor app on port:80
我的 mup.json 是
{
// Server authentication info
"servers": [
{
"host": "xxx.xxx.xxx.xxx",
"username": "__username___",
"pem": "__path_to_pem__",
"env": {}
}
],
// Install MongoDB on the server. Does not destroy the local MongoDB on future setups
"setupMongo": false,
// Application name (no spaces).
"appName": "__app_name__",
// 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": "__path_to_app_source__",
// Configure environment
// ROOT_URL must be set to your correct domain (https or http)
"env": {
"PORT": 1342,
"ROOT_URL": "https://xxx.xxx.xxx",
"MONGO_URL": "mongodb://__user__:__pass__@192.168.0.3:27017/__dbname__"
},
// 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": 120,
// show a progress bar while uploading.
// Make it false when you deploy using a CI box.
"enableUploadProgressBar": true
}
我手动准备了MongoDB。
我在这里度过了一整天,所以如果有人给我提示,我将不胜感激。
谢谢,
我在从 mup 切换到 mupx 时遇到了很多问题。
这个问题似乎与此有关:
https://github.com/arunoda/meteor-up/issues/958
我会尝试将 deployCheckWaitTime 增加到 600,看看是否能解决问题,
因为您可以从日志中看到它已部署并启动的应用程序:
[52.39.5.187] => Starting meteor app on port:80
部署应用程序后,mupx 会在 deployCheckWaitTime
选项指定的 n 秒后检查一切是否正常,因此如果您有很长时间,它可能会失败服务器启动时在主线程中运行。
我找到了解决办法。
发生这种情况是因为我对 AWS 和 Docker.
一无所知
我的安全组阻止 Docker 进程访问 Mongo。
我所要做的就是允许 Docker ip 地址访问 Mongo.
谢谢大家
我正在尝试使用 mupx 在 Ubuntu14.04/AWS 上部署 Meteor 应用程序。
这是我的环境。
服务器
节点:v5.10.0, npm:3.8.9, Ubuntu : 14.04
客户
节点:v5.5.0, npm:3.8.8, Mac:版本 10.11.014
mupx 设置 -> 一切正常。 mupx 部署 -> 验证部署:发生失败。
这是日志
-----------------------------------STDERR-----------------------------------
pm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
=> Starting meteor app on port:80
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
----------------------------------------------------------------------------
我做的时候 "mupx logs --tail=50" 我得到了...
------------------------------------------------
Configuration file : mup.json
Settings file : settings.json
[52.39.5.187] => Starting meteor app on port:80
[52.39.5.187] npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
/bundle/bundle/programs/server/node_modules/fibers/future.js:300
throw(ex);
^
[object Object]
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
[52.39.5.187] npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle@0.0.0 node npm-rebuild.js (wd=/bundle/bundle/programs/server)
[52.39.5.187] => Starting meteor app on port:80
我的 mup.json 是
{
// Server authentication info
"servers": [
{
"host": "xxx.xxx.xxx.xxx",
"username": "__username___",
"pem": "__path_to_pem__",
"env": {}
}
],
// Install MongoDB on the server. Does not destroy the local MongoDB on future setups
"setupMongo": false,
// Application name (no spaces).
"appName": "__app_name__",
// 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": "__path_to_app_source__",
// Configure environment
// ROOT_URL must be set to your correct domain (https or http)
"env": {
"PORT": 1342,
"ROOT_URL": "https://xxx.xxx.xxx",
"MONGO_URL": "mongodb://__user__:__pass__@192.168.0.3:27017/__dbname__"
},
// 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": 120,
// show a progress bar while uploading.
// Make it false when you deploy using a CI box.
"enableUploadProgressBar": true
}
我手动准备了MongoDB。
我在这里度过了一整天,所以如果有人给我提示,我将不胜感激。 谢谢,
我在从 mup 切换到 mupx 时遇到了很多问题。 这个问题似乎与此有关: https://github.com/arunoda/meteor-up/issues/958
我会尝试将 deployCheckWaitTime 增加到 600,看看是否能解决问题, 因为您可以从日志中看到它已部署并启动的应用程序:
[52.39.5.187] => Starting meteor app on port:80
部署应用程序后,mupx 会在 deployCheckWaitTime
选项指定的 n 秒后检查一切是否正常,因此如果您有很长时间,它可能会失败服务器启动时在主线程中运行。
我找到了解决办法。 发生这种情况是因为我对 AWS 和 Docker.
一无所知我的安全组阻止 Docker 进程访问 Mongo。 我所要做的就是允许 Docker ip 地址访问 Mongo.
谢谢大家