Support #898
Install PiCluster on Arch Linux ARM
Status:
Closed
Priority:
Normal
Assignee:
Category:
Jails / Containers
Target version:
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" }
- And edit the config file to suit your environment:
- 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 -
orsudo -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¶
Updated by Daniel Curtis over 7 years ago
- Description updated (diff)
- Status changed from New to In Progress
- % Done changed from 0 to 30
Updated by Daniel Curtis over 7 years ago
- Description updated (diff)
- % Done changed from 30 to 50
Updated by Daniel Curtis over 7 years ago
- Description updated (diff)
- % Done changed from 50 to 70
Updated by Daniel Curtis over 7 years ago
- Description updated (diff)
- % Done changed from 70 to 80
Updated by Daniel Curtis over 7 years ago
- Description updated (diff)
- % Done changed from 80 to 90
Updated by Daniel Curtis over 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