2

I need to run multiple instances of my node app in cluster mode on an Ubuntu 14.04 machine. The problem I've encountered with is that it doesn't work with a non-root user while it keeps saying:

Script /path/to/bin/server.js had too many unstable restarts (15). Stopped. "errored"

It works perfectly with root user though.

Mohebifar
  • 3,341
  • 1
  • 24
  • 32
  • The fact that pm2 is attempting to restart is an indication that it is running under non-root user. May be your application is accessing a folder which the current user does not have privilege to. Check pm2 logs, it might give you some information. Check if the user which you are using to run your application has rights for that folder. – kkites Jan 05 '16 at 07:07
  • Please beware of the number of node processes you spawn, it might not serve the purpose if your cores are less. – kkites Jan 05 '16 at 07:10
  • @kkites Privileges are ok. As I said, it works perfectly with root user when I pass `-i 0` option, so there shouldn't be anything wrong with number of instances. – Mohebifar Jan 05 '16 at 09:18

0 Answers0