GithubHelp home page GithubHelp logo

demo-node-pm2's Introduction

production mode start up

https://www.howtoing.com/install-pm2-to-run-nodejs-apps-on-linux-server

https://www.cnblogs.com/chyingp/p/pm2-documentation.html

https://larrylu.blog/nodejs-pm2-cluster-455ffbd7671

use pm2 to start node application

pm2 start server.js

specify the node instance

pm2 start server.js -i 4

scale the app to n instances

pm2 scale <server_name> <number_of_instance>

monitor the process

pm2 monit

show node detail

pm2 show <node_id>

more commands

sudo pm2 stop all                  		#stop all apps
sudo pm2 stop 0                    		#stop process with ID 0
sudo pm2 restart all               		#restart all apps
sudo pm2 reset 0		         	#reset all counters
sudo pm2 delete all                		#kill and remove all apps
sudo pm2 delete 1                 		#kill and delete app with ID 1


sudo pm2 logs                      	#view logs for all processes 
sudo pm2 logs 1	         	#view logs for app 1
sudo pm2 logs --json               	#view logs for all processes in JSON format
sudo pm2 flush			#flush all logs


sudo pm2 startup            #enable PM2 to start at system boot
sudo pm2 startup systemd    #or explicitly specify systemd as startup system 
sudo pm2 save               #save current process list on reboot
sudo pm2 unstartup          #disable PM2 from starting at system boot
sudo pm2 update	      #update PM2 package

demo-node-pm2's People

Contributors

studiofu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.