Project

General

Profile

Support #898

Install PiCluster on Arch Linux ARM

Added by Daniel Curtis almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Jails / Containers
Target version:
Start date:
06/06/2017
Due date:
% Done:

90%

Estimated time:
1.00 h
Spent time:

Description

This is a guide for installing PiCluster on Arch Linux ARM using a Raspberry Pi 3.

Prepare the Environment

  • Make sure the system is up to date:
    pacman -Syu
    
  • Install prerequisites:
    pacman -S docker git nodejs npm
    
  • Start and enable docker at boot:
    systemctl enable docker
    systemctl start docker
    

Install PiCluster

  • Download the latest PiCluster version from GitHub:
    git clone https://github.com/picluster/picluster.git /opt/picluster
    
  • Create a config file from the example:
    cp config-example.json config.json
    
  • Edit the config.json file:
    vi config.json
    
    • And edit the config file to suit your environment:
      NOTE: Use the web_connect key to the value of the host systems IP address. Otherwise you will get connection errors while starting the agent.
      {
        "token": "1234567890ABCDEFGHJKLMNOP",
        "docker": "/opt/picluster/docker",
        "server_port": "3000",
        "agent_port": "3001",
        "layout": [{
            "node": "picluster.example.com",
            "nginx": "-p 80:80",
            "minio": "-p 9000:9000" 
        }],
        "hb": [{
            "node": "picluster.example.com",
            "minio": "9000",
            "nginx": "80" 
        }],
        "container_host_constraints": [{
            "container": "nginx,localhost,127.0.0.1",
            "container": "minio,localhost,127.0.0.1" 
        }],
        "automatic_heartbeat": "disabled",
        "heartbeat_interval": "10000",
        "syslog": "dmesg",
        "web_username": "admin",
        "web_password": "admin",
        "web_connect": "127.0.0.1",
        "web_port": "3003" 
      }
      
  • Install and run server:
    cd /opt/picluster/server
    npm install
    
  • Install and run agent:
    cd ../agent
    npm install
    
  • Install and run web console:
    cd ../web
    npm install
    

Init with pm2

  • NOTE: Make sure to login to root with su - or sudo -i to preserve needed environment variables.
  • Install pm2:
    npm install -g pm2
    
  • Install the pm2 systemd init script as the picluster user:
    pm2 startup systemd
    
  • Export the picluster config filepath environment variable:
    export PICLUSTER_CONFIG='/opt/picluster/config.json'
    
  • Start the server, agent, and webconsole scripts:
    pm2 start /opt/picluster/server/server.js
    pm2 start /opt/picluster/agent/agent.js
    pm2 start /opt/picluster/web/webconsole.js
    
  • Save the pm2 session to restart at boot:
    pm2 save
    

Resources

#1

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 30
#2

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
#3

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
  • % Done changed from 30 to 50
#4

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
#5

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
  • % Done changed from 50 to 70
#6

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
  • % Done changed from 70 to 80
#7

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
#8

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
  • % Done changed from 80 to 90
#9

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)

Removed the following:

NOTE: I needed to set the config file path in the server.js, agent.js, and webconsole.js scripts to the absolute config path:

cd /opt/picluster/server
sed -i.bak -e "s/..\/config.json/\/opt\/picluster\/config.json/g" server.js

cd ../agent
sed -i.bak -e "s/..\/config.json/\/opt\/picluster\/config.json/g" agent.js

cd ../web
sed -i.bak -e "s/..\/config.json/\/opt\/picluster\/config.json/g" webconsole.js

#10

Updated by Daniel Curtis almost 7 years ago

  • Description updated (diff)
#11

Updated by Daniel Curtis over 6 years ago

  • Description updated (diff)
#12

Updated by Daniel Curtis about 6 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF