如何在 2015 年部署生产流星服务器?

How to deploy a production meteor server in 2015?

Meteor 已更改,并且缺少 docs.meteor.com 中的生产部署。

我在开发模式下有一个运行良好的 meteor 应用程序。所以我将它与新命令捆绑在一起,因为 bundle 已被弃用:

meteor build ./build/ --architecture os.linux.x86_64

在生产服务器上,我安装了最新版本的nodejs(目前是0.12),复制并解压构建。 Mongo DB 在另一台服务器上,所以我只是重新定义了 PORT、ROOT_URL、MONGO_OPLOG_URL 和 MONGO_URL 环境变量。

但很快就出现了常见的纤维缺失错误:

module.js:338
    throw err;
          ^
Error: Cannot find module 'fibers'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    ...........

所以,这是我尝试过的:

情况如下:

root@server:~# npm version
{ npm: '2.5.1',
  http_parser: '2.3',
  modules: '14',
  node: '0.12.0',
  openssl: '1.0.1l',
  uv: '1.0.2',
  v8: '3.28.73',
  zlib: '1.2.8' }
root@server:~# npm ls -g | grep fibers
├── fibers@1.0.5
root@server:/opt/meteor/authmonitor-src# meteor list-platforms
browser                                       
server

但我还是一样:错误:找不到模块'fibers'

问题:

谢谢,

我会用Meteor Up which automates lots of things. Here is a video tutorial from Sacha

Is there an up to date manual on how to deploy meteor applications on local production server?

不,没有官方文档。社区正在等待 MDG 发布 galaxy,它将成为 meteor 的付费托管服务。

Why / how should I install fibers module, and which version?

根据您所写的内容,我发现有几处可能存在问题:

解压包后,您需要:

$ cd bundle/programs/server && npm install

您无需全局安装任何节点模块即可让您的应用运行。

还建议您 运行 适合您的 meteor 版本的节点版本。查看 changelog 并搜索 'node'。在撰写本文时,推荐版本为 0.10.33.

托管

如果您在像 DigitalOcean 或 EC2 这样的相当简单的地方托管,我建议您使用 Meteor Up for your deploys. If you prefer to do the sysadmin tasks yourself, I suggesting reading my related answers here and here

另一种流行的托管选择是 modulus, becuase it's more full-service. You can read some tutorials here and here