2017-04-06 12:40:06 +01:00
|
|
|
# pm2
|
|
|
|
|
|
|
|
> Process manager for Node.js.
|
|
|
|
> Used for log management, monitoring and configuring processes.
|
2019-05-29 14:53:52 +01:00
|
|
|
> More information: <https://pm2.keymetrics.io>.
|
2017-04-06 12:40:06 +01:00
|
|
|
|
|
|
|
- Start a process with a name that can be used for later operations:
|
|
|
|
|
2022-10-23 16:33:58 +01:00
|
|
|
`pm2 start {{app.js}} --name {{application_name}}`
|
2017-04-06 12:40:06 +01:00
|
|
|
|
|
|
|
- List processes:
|
|
|
|
|
|
|
|
`pm2 list`
|
|
|
|
|
|
|
|
- Monitor all processes:
|
|
|
|
|
|
|
|
`pm2 monit`
|
|
|
|
|
2017-05-01 11:16:05 +01:00
|
|
|
- Stop a process:
|
2017-04-06 12:40:06 +01:00
|
|
|
|
2022-10-23 16:33:58 +01:00
|
|
|
`pm2 stop {{application_name}}`
|
2017-04-06 12:40:06 +01:00
|
|
|
|
2017-05-01 11:16:05 +01:00
|
|
|
- Restart a process:
|
2017-04-06 12:40:06 +01:00
|
|
|
|
2022-10-23 16:33:58 +01:00
|
|
|
`pm2 restart {{application_name}}`
|
2019-11-18 10:18:32 +00:00
|
|
|
|
|
|
|
- Dump all processes for resurrecting them later:
|
|
|
|
|
|
|
|
`pm2 save`
|
|
|
|
|
|
|
|
- Resurrect previously dumped processes:
|
|
|
|
|
|
|
|
`pm2 resurrect`
|