Correct way to restar/reload application for a different release

时间:2016-06-10 16:18:18

标签: node.js ubuntu pm2 process-management

I have following folder structure:

current
releases
  2192091029019/
  1029012901920/

Latest release gets pushed to current folder, and I afterwards start it wiht pm2 start, however If I upload new release with different folder name and do pm2 reload from new folder it still trys to reference original release from where application was started. Is there a way to restart application respecting new code?

1 个答案:

答案 0 :(得分:1)

此版本结构存在同样的问题,但supervisord + Rails代替pm2 + node。 在我的情况下,我需要完全重启supervisord每个部署来解决这个问题。 所以在你的情况下它可能会这样:

pm2 stop
kill -SIGTERM {pm2_pid}
pm2 startup

这是一种hackish但工作的解决方案。