Pm2: [v3.2.2] port already in use

Created on 31 Oct 2018  路  5Comments  路  Source: Unitech/pm2

When reloading using pm2,
'Port xxxx is already in use' occurs in 3.2.2.
It did not occur in 3.1.3.

  • ecosystem
module.exports = {
  "apps" : [{
    "name"                    : app_name,
    "cwd"                     : `${app_root}/current`,
    "script"                  : "./bin/www",
    "listen_timeout"        : 3000,
    "kill_timeout"            : 3000,
    "node_args"                 : [],
    "max_memory_restart"      : "500M",
    "instances"               : 2,
    "exec_mode"               : "cluster",
    "env": {
      "NODE_ENV"              : "dev",
      "NODE_PATH"             : `${app_root}/current`,
      "UV_THREADPOOL_SIZE"    : 4
    },
    "error_file"              : `${app_root}/current/log/error.log`,
    "out_file"                : `${app_root}/current/log/out.log`,
    "pid_file"                : `${app_root}/shared/tmp/pids/${app_name}.pid`
  }]
}
  • pm2 report
===============================================================================
--- PM2 REPORT (Wed Oct 31 2018 19:16:59 GMT+0900 (GMT+09:00)) ----------------
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 3.2.2
node version         : 10.13.0
node path            : /home/deploy/.nvm/versions/node/v10.13.0/bin/pm2
argv                 : /home/deploy/.nvm/versions/node/v10.13.0/bin/node,/home/deploy/.nvm/versions/node/v10.13.0/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : deploy
uid                  : 1000
gid                  : 1000
uptime               : 7min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 3.2.2
node version         : 10.13.0
node path            : /home/deploy/.nvm/versions/node/v10.13.0/bin/pm2
argv                 : /home/deploy/.nvm/versions/node/v10.13.0/bin/node,/home/deploy/.nvm/versions/node/v10.13.0/bin/pm2,report
argv0                : node
user                 : deploy
uid                  : 1000
gid                  : 1000
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel Xeon E312xx (Sandy Bridge, IBRS update)
cpus nb              : 2
freemem              : 239779840
totalmem             : 1927782400
home                 : /home/deploy
===============================================================================

Most helpful comment

Try
exec_mode: "cluster_mode"
I think they have deprecated "cluster" in exec_mode

All 5 comments

I have this problem too..

me too

Try
exec_mode: "cluster_mode"
I think they have deprecated "cluster" in exec_mode

Official documentation still writes fork|cluster though.

resolved!
thank you! @linuxgambler


could check from comment below.
https://github.com/Unitech/pm2/issues/3943#issuecomment-427389426

Was this page helpful?
0 / 5 - 0 ratings