From 1a0d5d99349628d6bf30c32823f25ad02a276f92 Mon Sep 17 00:00:00 2001 From: verita84 Date: Sat, 19 Dec 2020 22:07:14 +0000 Subject: [PATCH] --- PM2.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/PM2.md b/PM2.md index 979304a..6888867 100644 --- a/PM2.md +++ b/PM2.md @@ -4,18 +4,32 @@ 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 +``` +6. 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 +``` +reboot +``` \ No newline at end of file