安装并使用PM2

安装PM2:

cnpm install pm2@latest -g 或 tyarn global add pm2

 

启动项目:

pm2 start app.js

或

pm2 start bashscript.sh

或

pm2 start python-app.py --watch

或

pm2 start binary-file -- --port 1520

 

更新PM2版本:

cnpm install pm2@latest -g #先安装

pm2 update #然后更新内存中的PM2

 

其他命令:

pm2 ls #列出所有进程

pm2 stop all #停止所有进程

pm2 restart all #重启所有进程

pm2 reload all #重新加载所有进程,此时没有停机延时

pm2 delete all #删除所有进程

 

 

 

 

posted @ 2021-03-27 16:44  starlog  阅读(469)  评论(0编辑  收藏  举报