2015-06-18 73 views
0

而在集羣模式下啓動PM2我得到一個錯誤。 我跑這個命令 -錯誤PM2開始在Windows

pm2 start <filename> -i 4

只有一個實例被創建。 我使用Windows 7,節點0.12.0和PM2 0.14.0

這是我的錯誤日誌

2015-06-18 10:52:04: [PM2][WORKER] Started with refreshing interval: 30000 2015-06-18 10:52:04: [[[[ PM2/God daemon launched ]]]] 2015-06-18 10:52:04: BUS system [READY] on port \.\pipe\pub.sock 2015-06-18 10:52:04: RPC interface [READY] on port \.\pipe\rpc.sock 2015-06-18 10:52:04: Starting execution sequence in -cluster mode- for app name:server id:0 2015-06-18 10:52:04: App name:server id:0 online 2015-06-18 10:52:04: Starting execution sequence in -cluster mode- for app name:server id:1 2015-06-18 10:52:04: Trace: { [Error: spawn EBADF] code: 'EBADF', errno: 'EBADF', syscall: 'spawn' } at Object.God.logAndGenerateError (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\Methods.js:30:15) at Object.nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\ClusterMode.js:52:11) at Object.executeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:145:9) at ex (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:361:18) at C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:365:16 at Worker.cluOnline (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:188:17) at Worker.g (events.js:199:16) at Worker.emit (events.js:104:17) at online (cluster.js:449:12) at Worker.onmessage (cluster.js:436:7) 2015-06-18 10:52:04: Starting execution sequence in -cluster mode- for app name:server id:2 2015-06-18 10:52:05: Trace: { [Error: spawn EBADF] code: 'EBADF', errno: 'EBADF', syscall: 'spawn' } at Object.God.logAndGenerateError (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\Methods.js:30:15) at Object.nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\ClusterMode.js:52:11) at Object.executeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:145:9) at ex (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:361:18) at C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:362:25 at nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:146:29) at Object.nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\ClusterMode.js:53:14) at Object.executeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:145:9) at ex (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:361:18) at C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:365:16 2015-06-18 10:52:05: Starting execution sequence in -cluster mode- for app name:server id:3 2015-06-18 10:52:05: Trace: { [Error: spawn EBADF] code: 'EBADF', errno: 'EBADF', syscall: 'spawn' } at Object.God.logAndGenerateError (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\Methods.js:30:15) at Object.nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\ClusterMode.js:52:11) at Object.executeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:145:9) at ex (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:361:18) at C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:362:25 at nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:146:29) at Object.nodeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God\ClusterMode.js:53:14) at Object.executeApp (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:145:9) at ex (C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:361:18) at C:\Users\pbaid\AppData\Roaming\npm\node_modules\pm2\lib\God.js:362:25

回答

0

我今天遇到這個問題了。

如果我的任何其他PM2操作之前運行「PM2日誌」,然後開始在集羣模式的應用程序(「PM2開始app.js -i 4」),一切都看起來不錯。看來pm2需要一些時間進行初始化。我不知道真正的原因。

期待着更好的解決方案了。

-2

在Windows上,不要使用集羣:

pm2 start "filename.js"