maodouio / meteor-master-classes

毛豆网Meteor在线师徒班
http://www."培养国内第一批Meteor布道者".com
15 stars 7 forks source link

mup deploy 在阿里云和digitalocean上失败 [存档] #29

Open ennea8 opened 9 years ago

ennea8 commented 9 years ago

部署crowducate-next程序

ennea8@crowducate-next-ennea8$ mup setup

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Started TaskList: Setup (linux) [120.27.39.227] - Installing Node.js [120.27.39.227] - Installing Node.js: SUCCESS [120.27.39.227] - Setting up Environment [120.27.39.227] - Setting up Environment: SUCCESS [120.27.39.227] - Configuring upstart [120.27.39.227] - Configuring upstart: SUCCESS Completed TaskList: Setup (linux) ennea8@crowducate-next-ennea8$ mup deploy

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Building Started: /Users/ennea8/Desktop/crowducate-next-ennea8

Started TaskList: Deploy app 'weike' (linux) [120.27.39.227] - Uploading bundle [120.27.39.227] - Uploading bundle: SUCCESS [120.27.39.227] - Setting up Environment Variables [120.27.39.227] - Setting up Environment Variables: SUCCESS [120.27.39.227] - Invoking deployment process [120.27.39.227] - Invoking deployment process: SUCCESS Completed TaskList: Deploy app 'weike' (linux) ennea8@crowducate-next-ennea8$ mup setup

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Started TaskList: Setup (linux) [120.27.39.227] - Installing Node.js [120.27.39.227] - Installing Node.js: SUCCESS [120.27.39.227] - Setting up Environment [120.27.39.227] - Setting up Environment: SUCCESS [120.27.39.227] - Configuring upstart [120.27.39.227] - Configuring upstart: SUCCESS Completed TaskList: Setup (linux) ennea8@crowducate-next-ennea8$ mup deploy

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Building Started: /Users/ennea8/Desktop/crowducate-next-ennea8

Started TaskList: Deploy app 'weike' (linux) [120.27.39.227] - Uploading bundle [120.27.39.227] - Uploading bundle: SUCCESS [120.27.39.227] - Setting up Environment Variables [120.27.39.227] - Setting up Environment Variables: SUCCESS [120.27.39.227] - Invoking deployment process [120.27.39.227] - Invoking deployment process: SUCCESS Completed TaskList: Deploy app 'weike' (linux) ennea8@crowducate-next-ennea8$ mup setup

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Started TaskList: Setup (linux) [162.243.155.134] - Installing Node.js [162.243.155.134] - Installing Node.js: SUCCESS [162.243.155.134] - Setting up Environment [162.243.155.134] - Setting up Environment: SUCCESS [162.243.155.134] - Copying MongoDB configuration [162.243.155.134] - Copying MongoDB configuration: SUCCESS [162.243.155.134] - Installing MongoDB [162.243.155.134] - Installing MongoDB: SUCCESS [162.243.155.134] - Configuring upstart [162.243.155.134] - Configuring upstart: SUCCESS Completed TaskList: Setup (linux) ennea8@crowducate-next-ennea8$ mup deploy

Meteor Up: Production Quality Meteor Deployments

“ Checkout Kadira! It's the best way to monitor performance of your app. Visit: https://kadira.io/mup

Building Started: /Users/ennea8/Desktop/crowducate-next-ennea8

Started TaskList: Deploy app 'weike' (linux) [162.243.155.134] - Uploading bundle [162.243.155.134] - Uploading bundle: SUCCESS [162.243.155.134] - Setting up Environment Variables [162.243.155.134] - Setting up Environment Variables: SUCCESS [162.243.155.134] - Invoking deployment process [162.243.155.134] x Invoking deployment process: FAILED

    -----------------------------------STDERR-----------------------------------
    _root_dir=/root/.node-gyp/0.10.32',
    gyp info spawn args   '-Dmodule_root_dir=/opt/weike/tmp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--no-parallel',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'build',
    gyp info spawn args   '-Goutput_dir=.' ]
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    gyp info ok 
    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
    stop: Unknown instance: 
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 8000: Connection refused App did not pick up! Please check app logs. -----------------------------------STDOUT----------------------------------- rypt_lib.node SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node: Finished COPY Release/bcrypt_lib.node make: Leaving directory `/opt/weike/tmp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build'

    > fibers@1.0.5 install /opt/weike/tmp/bundle/programs/server/node_modules/fibers
    > node ./build.js

    `linux-x64-v8-3.14` exists; testing
    Binary is fine; exiting
    underscore@1.5.2 node_modules/underscore

    semver@4.1.0 node_modules/semver

    chalk@0.5.1 node_modules/chalk
    ├── ansi-styles@1.1.0
    ├── escape-string-regexp@1.0.3
    ├── supports-color@0.2.0
    ├── has-ansi@0.1.0 (ansi-regex@0.2.1)
    └── strip-ansi@0.3.0 (ansi-regex@0.2.1)

    eachline@2.3.3 node_modules/eachline
    └── type-of@2.0.1

    fibers@1.0.5 node_modules/fibers

    source-map-support@0.2.8 node_modules/source-map-support
    └── source-map@0.1.32 (amdefine@0.1.0)
    Waiting for MongoDB to initialize. (5 minutes)
    connected
    weike start/running, process 28712
    Waiting for 15 seconds while app is booting up
    Checking is app booted or not?
    ----------------------------------------------------------------------------

Completed TaskList: Deploy app 'weike' (linux)

ennea8 commented 9 years ago

这个部署失败与我更改nodejs版本有关, Meteor要求v0.10.36及以上,我把 nodejs版本改为了0.10.32 ("nodeVersion": "0.10.32",) root@coffeewoo:/opt/weike/app# node main.js Meteor requires Node v0.10.36 or later.

但在阿里云上即使没改这个node版本 也是不成功的,可能是其他原因

kevingzhang commented 9 years ago

我以前见过类似的错误信息都是 node.js 的版本. 升级 node 的版本, 在美国这里(amazon)就解决了这个问题. 中国那边的问题很大可能性是出在防火墙上. 因为很可能某一个模块需要从某个服务器下载, 而不幸地是更好被防火墙给封了. 因此会产生一连串的错误, 最终显示都是这样的错误信息.

目前我并没有解决方案, 因为我也不知道到底哪个部分造成的问题.

如果你最终发现了解决方案, 请务必贴在这里. 谢啦

ennea8 commented 9 years ago

恩 确实meteor对开发环境或部署环境的要求一些地方还不是那么明确 以前也遇到过telescope在512内存的digitalocean上是运行不了的问题,会直接报内存不够用的错误,网上也有人提出这样的问题,但直接建个空的meteor工程到可以运行,也可能是telescope的要求

kevingzhang commented 9 years ago

一个真的有用的 app 估计都很难在512内存上运行. 所以这个报错是完全可以理解的.

limingth commented 9 years ago

@ennea8 可以参考 @wmzhai 的安装文档 https://github.com/ennea8https://github.com/wmzhai/setup-meteor-machine

有几个 mup setup 用的包需要翻墙才行,所以下载到本地从文件安装就没问题。

我在 aliyun 上的 mup deploy 是成功的,但是连接网站,在 console 里面出现这样的错误:

image

kevingzhang commented 9 years ago

这个问题我再考虑另外的解决方案. 我们是否可以在美国建立一个 Meteor 的 Docker image, 全部安装好运行环境. 然后直接 pull 到中国某个支持 docker 的运行环境中. 这样就不需要翻墙安装什么包之类的. 因为 Docker container 本来就是干这个用的. 把一个整个运行环境放入集装箱拉着走.

leetschau commented 9 years ago

好办法!不过与mup直接安装在物理机上相比,用docker是否会影响Web服务器的性能?

kevingzhang commented 9 years ago

你应该听一下这个 webinar https://www.crowdcast.io/e/meteorhacks-show-may-2015

在10小时以后播出. 应该可以解释你的问题. 你的问题实际上可以理解为"什么是 docker? 什么作用"

On Tue, May 5, 2015 at 11:22 PM, Chad notifications@github.com wrote:

好办法!不过与mup直接安装在物理机上相比,用docker是否会影响Web服务器的性能?

— Reply to this email directly or view it on GitHub https://github.com/maodouio/meteor-master-classes/issues/29#issuecomment-99341253 .

╭︿︿︿╮ {/ o o /} ( (oo) ) Kevin G. Zhang :) ︶ ︶︶

ennea8 commented 9 years ago

我目前在阿里云上部署成功了,但digitalocean上还有nodeJS版本问题没顾得去解决和总结所以这个一直没回 阿里上部署crowducate大概遇到两个问题 1.部署不成功 2.部署成功后不能运行 报错 这两个问题大致可通过如下方式解决。 1.部署不成功应该和已有nodejs版本以及网络有关 a.删除已有nodejs版本 b.部署过程会出现卡在一个地方不停的现象,打开mup的源码,里面是一系列shell脚本,可通过ssh登录server 手动copy并运行这些脚本,同时会看到详细的过程信息 根据提示去解决,最后若还不行就手动下载安装了。 在阿里云我可能删除nodejs后就已经OK

2.部署成功后不能运行 这是crowducate的问题它缺少了 bootstrap 3的package,执行 meteor add twbs:bootstrap 即可。 测试环境下crowducate也是报错的,但由于js文件是独立的,所以不影响主体功能, 但当部署后js会压缩为一个文件,执行过程中一旦有错,后面就全不执行了,导致整个程序不能显示了 所以部署前要确保 console里不报错

部署时mup中设置的版本与已有nodejs版本的关系,是否真有必要删除已有nodejs,待测试。 有一点比较肯能,server上的版本应不低于mup中设置的版本,build后的版本会根据mup设置生成如下类似的代码对版本进行限制 var MIN_NODE_VERSION = 'v0.10.36';

luckyyang commented 9 years ago

@limingth https://github.com/meteor/meteor/pull/2482

In local mode, the JS files are not minified, and are loaded as a sequence of script tags (one per package). If there's an uncaught exception in one file, the browser will log it, stop executing that script and continue with the others.

In contrast, in production mode, the JS is minified. Each JS script is concatenated into one big JS file, which is then minified and served as one script. Now an uncaught exception causes the browser to stop execution of everything.

kevingzhang commented 9 years ago

感谢 ennea8的钻研精神, 这就是 Hacker 的本色!

ennea8 commented 9 years ago

汗 good good study, day day up O(∩_∩)O~