0

In order to support the most recent versions of NodeJS, we need to migrate our web servers from Amazon Linux 2 to Amazon Linux 2023. Making this move precludes us from doing the usual spin-up/down instances, and involves a full migration.

Everything seems to be working smoothly, except for node-based services. What I did was copy .pm2/dump.pm2 to a new server and launch pm2 as a service. It initially looked fine, but it shows none of the services are taking any CPU or RAM, and apache proxy connections are failing to connect, so I think none of them are actually running. I tried pm2 resurrect as well, but the response is the same:

# pm2 resurrect
[PM2] Resurrecting
[PM2] Restoring processes located in /root/.pm2/dump.pm2
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 3  │ IDAP Dev           │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 4  │ IDAP Website       │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 2  │ Mirovoy NextJS     │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 5  │ Reanthropize       │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 6  │ Reanthropize Stage │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 1  │ lp-api             │ fork     │ 0    │ online    │ 0%       │ 0b       │
│ 0  │ url-shortener      │ fork     │ 0    │ online    │ 0%       │ 0b       │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘

Systemctl also seems to think it's working:

# systemctl status pm2-root
● pm2-root.service - PM2 process manager
     Loaded: loaded (/etc/systemd/system/pm2-root.service; enabled; preset: dis>
     Active: active (running) since Sun 2023-08-27 10:44:43 UTC; 1h 7min ago
       Docs: https://pm2.keymetrics.io/
    Process: 135008 ExecStart=/root/.nvm/versions/node/v18.17.1/lib/node_module>
   Main PID: 135015 (PM2 v5.3.0: God)
      Tasks: 11 (limit: 4568)
     Memory: 20.3M
        CPU: 925ms
     CGroup: /system.slice/pm2-root.service
             └─135015 "PM2 v5.3.0: God Daemon (/root/.pm2)"

Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: ├────┼─>
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 3  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 4  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 2  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 5  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 6  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 1  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: │ 0  │ >
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal pm2[135008]: └────┴─>
Aug 27 10:44:43 ip-10-0-6-45.eu-central-1.compute.internal systemd[1]: Started >

Assuming everything is where it's supposed to be and otherwise working, what's the right way to get pm2 to re-launch all of its services on the new machine? There are only 7 services, so I could, of course, just go start them all manually, but ... I would think there's some way to do this automatically.

2
  • I'm not sure I understand the objection. PM2 is used for managing IT systems, in this case in production (though I guess it could also be used in dev/test). I'm happy for the Q to be relocated to Stack Overflow if it makes more sense, but not sure why. Aug 27 at 14:02
  • 1
    OK. Edited to make the environment clear. Can you remove your vote to close? Aug 27 at 14:27

0

You must log in to answer this question.

Browse other questions tagged .