Misc $ pm2 reset # Reset meta data (restarted time.) $ pm2 updatePM2 # Update in memory pm2 $ pm2 ping # Ensure pm2 daemon has been launched $ pm2 sendSignal SIGUSR2 my-app # Send system signal to script $ pm2 start app.js -no-daemon $ pm2 start app.js -no-vizion $ pm2 start app. $ pm2 delete 0 # Will remove process from pm2 list $ pm2 delete all # Will remove all processes from pm2 list $ pm2 stop 0 # Stop specific process id $ pm2 restart 0 # Restart specific process id Monit can be started up with a command that then keeps it running in the. Once monit downloads, you can add programs and processes to the configuration file: sudo nano /etc/monit/monitrc. Monit is easiest to install through apt-get: sudo apt-get install monit. $ pm2 reload all # Will 0s downtime reload (for NETWORKED apps) This tutorial will cover the most basic setup and configuration. Logs $ pm2 logs # Display all processes logs in streaming $ pm2 flush # Empty all log files $ pm2 reloadLogs # Reload all logsĪctions $ pm2 stop all # Stop all processes $ pm2 restart all # Restart all processes $ pm2 describe 0 # Display all information about a specific process Listing $ pm2 list # Display all processes status $ pm2 jlist # Print process list in raw JSON $ pm2 prettylist # Print process list in beautified JSON $ pm2 scale app +3 # Scales `app` up by 3 workers $ pm2 scale app 2 # Scales `app` up or down to 2 workers total Just try them with a sample application or with your current web application on your development machineįork mode $ pm2 start app.js -name my-api # Name processĬluster mode $ pm2 start app.js -i 0 # Will start maximum processes with LB depending on available CPUs $ pm2 start app.js -i max # Same as above, but deprecated. The reason you and I would need to do this is to refresh the inputs so that we can list what actually sits in the config files. Here are some commands that are worth knowing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |