pm2 在unbuntu上不能运行服务
发布于 9 个月前 作者 Tianfer 702 次浏览 来自 问答

代码在本地的mac ox环境上能运行,但是放到ubuntu上就不行了 先pm2 start app.js,显示如下 Name │ mode │ status │ ↺ │ cpu │ memory │ ├──────┼──────┼────────┼───┼─────┼───────────┤ │ app │ fork │ online │ 0 │ 4% │ 16.6 MB │ 然后pm2 list 显示如下 Name │ mode │ status │ ↺ │ cpu │ memory │ ├──────┼──────┼─────────┼────┼─────┼────────┤ │ app │ fork │ errored │ 15 │ 0% │ 0 B │ 日志错误显示如下 PM2 | 2017-02-22 10:21:14: Starting execution sequence in -fork mode- for app name:app id:0 PM2 | 2017-02-22 10:21:14: App name:app id:0 online PM2 | 2017-02-22 10:21:14: App [app] with id [0] and pid [15514], exited with code [1] via signal [SIGINT] PM2 | 2017-02-22 10:21:14: Starting execution sequence in -fork mode- for app name:app id:0 PM2 | 2017-02-22 10:21:14: App name:app id:0 online PM2 | 2017-02-22 10:21:14: App [app] with id [0] and pid [15523], exited with code [1] via signal [SIGINT] PM2 | 2017-02-22 10:21:14: Starting execution sequence in -fork mode- for app name:app id:0 PM2 | 2017-02-22 10:21:14: App name:app id:0 online PM2 | 2017-02-22 10:21:15: App [app] with id [0] and pid [15532], exited with code [1] via signal [SIGINT] PM2 | 2017-02-22 10:21:15: Script /node/jade+express/app.js had too many unstable restarts (16). Stopped. “errored”

在本地不会有这样的错误,3000端口和80端口都试过了,在服务器上都有错,求大神解救

6 回复

应该是程序的问题吧

肯定是代码问题了,先用node命令启动下你的代码看看

@jiangli373 不是啊,我写个普通的demo.js也是上面的情况

@imhered 不是啊,我写个普通的demo.js也是上面的情况

@Tianfer 那用cluster启动,然后查看errorlog

@imhered 谢谢您的帮助,已经解决。不过没用cluster,是少安装了一些模块

回到顶部