Project

General

Profile

Support #905

Install PiCluster on Ubuntu

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Jails / Container
Start date:
07/09/2017
Due date:
% Done:

100%

Estimated time:
1.50 h
Spent time:

Description

This is a guide for installing PiCluster on Ubuntu 16.04.

Prepare the Environment

  • Switch to root:
    sudo -i
    
  • Make sure the system is up to date:
    apt-get update && apt-get upgrade
    
  • Install prerequisites:
    apt-get install docker git nodejs nodejs-legacy 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
    
  • 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 server:
    cd /opt/picluster/
    npm install
    

Init with pm2

  • 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
    
  • Enable pm2 at boot:
    systemctl enable pm2-root
    

Resources

#1

Updated by Daniel Curtis over 7 years ago

  • Status changed from New to In Progress
  • Start date changed from 07/08/2017 to 07/09/2017
  • % Done changed from 0 to 30
#2

Updated by Daniel Curtis over 7 years ago

  • Description updated (diff)
  • Status changed from In Progress to Resolved
  • % Done changed from 30 to 100
#3

Updated by Daniel Curtis over 7 years ago

  • Description updated (diff)
#4

Updated by Daniel Curtis about 7 years ago

  • Description updated (diff)
  • Status changed from Resolved to Closed

Also available in: Atom PDF