Sunday, May 1, 2022

getting started with PM2

a)  Install:

 sudo npm install pm2 -g

b) Start Node api in cluster mode

pm2 --name <apiname> start index.js -i 2

c) Save Pm2 job

pm2 save


d) auto start at reboot

pm2 startup


e) reload without downtime

pm2 reload all




No comments:

Post a Comment