PM2 Deploying multiple Nodejs project configuration Tutorials

Source: Internet
Author: User

In the actual project deployment, our server needs to start the node service automatically when it starts. Previously, it was started with a command that comes with Liunx. But with the background microservices more and more. Each time a new program is released. It's too much trouble to modify the script. And then replaced by PM2 to do.

1. First install the PM2

NPM install-g PM2

2. Build the configuration file

PM2 Ecosystem build completed there will be a ecosystem.config.js file,

3. Modify the configuration file

Edit Ecosystem.config.js

。 The main needs to configure the program name, the program startup script. You can do it.

4. Start the configuration file

PM2 Startorrestart Ecosystem.config.js

5. View the startup situation

PM2 List

The delegate program started successfully.

The script Start command enables multiple node versions to be supported with NVM.

PM2 Deploying multiple Nodejs project configuration Tutorials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.