I am using pm2 to manage my node.js processes. Very happy with it so far.
What is the purpose of $ pm2 save
? What is the purpose of saving a process list? I don't quite understand from the documentation.
https://github.com/Unitech/pm2
I am using pm2 to manage my node.js processes. Very happy with it so far.
What is the purpose of $ pm2 save
? What is the purpose of saving a process list? I don't quite understand from the documentation.
https://github.com/Unitech/pm2
pm2 save
takes a snapshot of your currently running Node applications. You can then restore these applications using pm2 resurrect
.
This is useful because it means you don't have to manually restart each application when you restart pm2 (such as a machine reboot). Instead, you can just have a script that calls pm2 resurrect
and it'll start up all the Node apps.
pm2 resurrect
is useful to be called manually. If you want your processes to automatically start on boot, you should create a startup script with pm2 startup
.
pm2 resurrect
is useful to be called manually. If you want your processes to automatically start on boot, you should create a startup script with pm2 startup
. More info here: pm2.keymetrics.io/docs/usage/startup –
Excruciation pm2 save
dumps the list of running apps to ~/pm2/dump.pm2
, and the script generated by pm2 startup
uses it to run the apps when the server is rebooted. –
Cristincristina pm2 startup
is usefull, but what if my user is NOT a SUDO and I do not want the sudo to uses pm2 at all. I havve a dedicated user for these jobs, but seemingly if I execute the sscript provided by the command (without the SUDO part), it just repeats itself. IDK if it actually made it work or not –
Bottommost $ pm2 save
is used to save the pm2 process list to relaunch them after a server reboot. It comes generaly with :
pm2 startup
which generates Startup Script
© 2022 - 2024 — McMap. All rights reserved.