TODO:Node.js PM2 How to use
The PM2 is a process manager for a node app with load-balancing capabilities.
PM2 is perfect when you want to take advantage of all of your standalone code on all the CPUs on the server and ensure that the process is always alive, with 0 seconds of overloading.
1. Installing PM2 using NPM install Pm2-g
2. Using PM2 to manage the node process, execute the following command to start the node service:
PM2 Start Process.json
Error log output, less ~/.pm2/logs/video-error.log,node error:cannot find module ' Express ':
3. Setting Node_path Environment variables
Export path= $PATH:/data/node/node-v6.9.1-linux-x64/bin
Export node_path= "/data/node/node-v6.9.1-linux-x64/lib/node_modules"
4. Install the dependent warranty
NPM install-d
5. Start the node service, PM2 start Process.json
6. Test if the service port is turned on, telnet 127.0.0.1 9994
7. Stop PM2 Management app,pm2 stop Video,status to stopped stop successful
8. Start PM2 managed app,pm2 start video,status for online then start successfully
9. More PM2 use method, you can use Pm2–help to view the detailed usage method
$ PM2 List
$ PM2 Stop
$ PM2 Restart
$ PM2 Delete
Wxgzh:ludong86
TODO:Node.js PM2 How to use