PM2命令行列表

# start and add a process to your list
pm2 start app.js

# show your list
pm2 ls

# stop and delete a process from the list
pm2 delete app

# kill the process but keep it in the process list
pm2 stop app

# start the process again
pm2 start app

# both stop and start
pm2 restart app
pm2 restart app1 app2 app3

#使用正则
pm2 restart /app/

#生成一个 ecosystem.config.js 模版:
pm2 init
pm2 start ecosystem.config.js
pm2 stop ecosystem.config.js
pm2 restart ecosystem.config.js
pm2 reload ecosystem.config.js
pm2 restart ecosystem.config.js --only app

#监控
pm2 monit

# all apps logs 日志
pm2 logs

# only app logs
pm2 logs app

# clear all logs
pm2 flush

# 群集模式
pm2 start app.js -i max

#module.exports = {
#  apps: [{
#    script: "app.js",
#    instances: "max",
#  }]
#}
PM2命令行列表_第1张图片
image.png

你可能感兴趣的:(PM2命令行列表)