我试图在我的系统上运行 node.js 但遇到了这个问题:
2016-06-01 20:46:28: App [app] with id [13] and pid [12633], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:28: Starting execution sequence in -cluster mode- for app name:app id:13
2016-06-01 20:46:28: App name:app id:13 online
2016-06-01 20:46:28: App name:app id:4 disconnected
2016-06-01 20:46:28: App [app] with id [4] and pid [47284], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:28: Starting execution sequence in -cluster mode- for app name:app id:4
2016-06-01 20:46:29: App name:app id:4 online
2016-06-01 20:46:44: App name:app id:3 disconnected
2016-06-01 20:46:44: App [app] with id [3] and pid [42456], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:44: Starting execution sequence in -cluster mode- for app name:app id:3
2016-06-01 20:46:44: App name:app id:3 online
2016-06-01 20:46:45: App name:app id:2 disconnected
2016-06-01 20:46:45: App [app] with id [2] and pid [47045], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:45: Starting execution sequence in -cluster mode- for app name:app id:2
2016-06-01 20:46:45: App name:app id:2 online
2016-06-01 20:46:49: App name:app id:6 disconnected
2016-06-01 20:46:49: App [app] with id [6] and pid [47326], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:49: Starting execution sequence in -cluster mode- for app name:app id:6
2016-06-01 20:46:49: App name:app id:6 online
2016-06-01 20:46:49: App name:app id:10 disconnected
2016-06-01 20:46:49: App [app] with id [10] and pid [47291], exited with code [0] via signal [SIGINT]
2016-06-01 20:46:49: Starting execution sequence in -cluster mode- for app name:app id:10
2016-06-01 20:46:49: App name:app id:10 online
2016-06-01 20:48:33: App name:app id:2 disconnected
我使用 pm2 运行 node.js,但由于以下原因它经常重新启动:通过信号 [SIGINT] 以代码 [0] 退出
。这是为什么?
一些附加信息:
~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 9.8G 28G 27% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 7.9G 4.0K 7.9G 1% /dev
tmpfs 1.6G 380K 1.6G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.9G 0 7.9G 0% /run/shm
none 100M 0 100M 0% /run/user
~$ free -m
total used free shared buffers cached
Mem: 16035 8177 7857 0 174 3672
-/+ buffers/cache: 4331 11704
Swap: 0 0 0
~$ node -v
v5.1.1
~$ npm -v
3.3.12
最佳答案
我遇到了同样的问题,pm2 每秒重新启动一次,正常运行时间为 0。我找到了解决办法:
pm2 start bin/www -i 0
//这将启动集群和主应用pm2 stop 0
//这将允许集群继续运行
关于javascript - pm2运行node.js,但是经常重启:exited with code [0] via signal [SIGINT],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37612081/