verita84 2020-12-18 05:40:06 +00:00
commit e57d59aefb

21
PM2.md Normal file

@ -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