Project

General

Profile

Support #909

Install PiCluster on Arch Linux

Added by Daniel Curtis over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Jails / Container
Target version:
Start date:
08/10/2017
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

This is a guide for installing PiCluster on Arch Linux.

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
    cd /opt/picluster
    
  • Create a config from the example config file:
    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":"45FG9A23DE12045E20BB854AC",
        "docker":"/opt/picluster/docker",
        "server_port":"3000",
        "agent_port": "3001",
        "layout": [
          {"node":"192.168.1.191", "mysql":"-p 3306:3306","nginx":"-p 80:80"},
          {"node":"192.168.1.192", "openvpn":"-p 1194:1194"}],
        "hb": [
          {"node":"192.168.1.191","mysql":"3306", "nginx": "80"},
          {"node":"192.168.1.192","openvpn":"1194"}
        ],
        "vip": [
          {"node":"192.168.1.191","vip_eth_device":"eth0", "slave": "192.168.1.192", "vip_ping_time": "10000"},
          {"node":"192.168.1.192","vip_eth_device":"eth0","slave": "192.168.1.191", "vip_ping_time": "15000"}
        ],
        "commandlist": [{
        "SystemUpdate": "pacman -Syu --yes" 
        }],
        "vip_ip": "192.168.1.202",
        "autostart_containers": "enabled",
        "rsyslog_logfile": "/var/log/syslog",
        "rsyslog_host": "192.168.1.202",
        "automatic_heartbeat": "enabled",
        "heartbeat_interval": "300000",
        "syslog": "dmesg",
        "web_username": "admin",
        "web_password":"admin",
        "web_connect":"192.168.1.190",
        "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
    
  • Exit back into root shell:
    exit
    

Init with pm2

  • Install pm2:
    pacman -S 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 about 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF