From e57d59aefbac483d75697ea8eb090093b464ceaf Mon Sep 17 00:00:00 2001 From: verita84 Date: Fri, 18 Dec 2020 05:40:06 +0000 Subject: [PATCH] --- PM2.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 PM2.md diff --git a/PM2.md b/PM2.md new file mode 100644 index 0000000..979304a --- /dev/null +++ b/PM2.md @@ -0,0 +1,21 @@ +Welcome to the Wiki. + +Using pm2 to init PiCluster on systemd +0. Login as root to install pm2 +sudo -i +1. Install pm2 +npm install -g pm2 +2. Install the pm2 systemd unit file +pm2 startup systemd +3. Export the PiCluster config path (change the path accordingly) +export PICLUSTER_CONFIG='/opt/picluster/config.json' +4. Start the server, agent, and webconsole scripts (change the path accordingly) +pm2 start /opt/picluster/server/server.js +pm2 start /opt/picluster/agent/agent.js +pm2 start /opt/picluster/web/webconsole.js +5. Save the pm2 session to restart at boot +pm2 save +6. Enable pm2 at boot: +systemctl enable pm2-root +7. Reboot for the services to be started properly +Reboot \ No newline at end of file