pm2

Problem running express app with pm2 using ecosystem config file

你说的曾经没有我的故事 提交于 2021-01-28 20:23:52
问题 When I run my Node.js express app using node command everything works fine! When using pm2 server ./bin/www` my pm2 status is something like this: And my app works in this situation. Also when I use pm2 start bin "./bin/www" -i 0 my pm2 list shows: And yet again my app works. But using following config file: module.exports = { apps: [{ name: 'cdn', script: './bin/www', instances: 0, exec_mode: 'cluster', watch: true, env: { NODE_ENV: 'production', PORT: process.env.PORT || '5555', } }] }; the

PM2 Catching Errored State Signal

爷,独闯天下 提交于 2021-01-07 02:42:25
问题 I am trying to catch the process before it goes into the state of errored. The process I am running is erroring and restarting correctly. After 15 attempts of restarting it will go into a state of errored, as shown for the process with an ID of 0 below. ┌─────┬─────────────────────────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │

How to run MongoDB using PM2

旧街凉风 提交于 2020-12-04 08:53:40
问题 How do I run MongoDB using PM2? I'm using a Linux VPS (CentOS) and I tried doing this: pm2 mongod ^ and that works but the problem is I need to bind IP and DBPath name pm2 mongod -dbpath /home/[ommitted]/data/db --bind_ip [ommitted] -auth ^ But that doesn't work because of PM2 flags. So how can I run it using PM2 or at least make it so it doesn't shut down when I close the terminal 回答1: You can create an SH file that runs the command, then run the SH file. 1. For example, name it "run.sh" 2.