pm2 list # 显示所有进程状态 pm2 jlist # Print process list in raw JSON pm2 prettylist # Print process list in beautified JSON pm2 info 0 # Display all informations about a specific process
运行控制
1 2 3 4 5 6 7 8 9 10 11 12
pm2 stop 0 # 停止指定进程 pm2 stop all # 停止所有进程 pm2 restart 0 # Restart specific process id pm2 restart all # 重启所有进程 pm2 delete 0 # Will remove process from pm2 list pm2 delete all # Will remove all processes from pm2 list pm2 reload 0 # 类似restart,0秒重载,支持 cluster_mode pm2 reload all # Will 0s downtime reload (for NETWORKED apps) pm2 gracefulReload all # Send exit message then reload (for networked apps) pm2 dump # ~/.pm2/dump.pm2 pm2 kill# 杀掉PM2 pm2 resurrect # 复活所有进程
pm2 logs # 显示所有进程日志 pm2 ilogs # Advanced termcaps interface to display logs pm2 flush # Empty all log file pm2 reloadLogs # Reload all logs
杂项
1 2 3 4 5 6
pm2 ping # Ensure pm2 daemon has been launched pm2 reset <process> # Reset meta data (restarted time...) pm2 sendSignal SIGUSR2 my-app # Send system signal to script pm2 start app.js --no-daemon # run pm2 daemon in the foreground pm2 describe id|all #查看启动程序的详细信息 pm2 web #API(端口:9615)