美文网首页
nodejs 进程管理

nodejs 进程管理

作者: encoded | 来源:发表于2016-10-31 11:52 被阅读78次

之前一直是用screen管理进程

1.给应用程序开个screen,如:screen  ,进入程序目录, 然后启动程序

2.退出该后台:ctrl + a,再按d,可不能直接ctrl +c,否则就退出了

3.再次进入需要 screen -r -d   id

如今高大上的部署方式-PM2

安装:npm install -g pm2

启动程序:pm2 start  <name | id | all>      pm2 start xx.js --name xx

列举进程:pm2 list

退出程序:pm2 stop <name | id |all>
删除进程:pm2 delete id

重起应用:pm2 restart

程序信息:pm2 describe  id|all 

监控:pm2 monit

实时集中log处理: pm2 logs

API:pm2 web (端口:9615 )

相关文章

网友评论

      本文标题:nodejs 进程管理

      本文链接:https://www.haomeiwen.com/subject/hzfuyttx.html