Swarmlab docs

Application development in a distributed system

Development of Distributed Systems from Design to Application


You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.4 KiB

3 years ago
= Setup
TIP: Tested on a Raspberry Pi with "Buster"
== Intro
networkd is a small and lean service to configure network interfaces, designed mostly for server use cases in a world with hotplugged and virtualized networking. Its configuration is similar in spirit and abstraction level to ifupdown, but you don't need any extra packages to configure bridges, bonds, vlan etc. It is not very suitable for managing WLANs yet; NetworkManager is still much more appropriate for such Desktop use cases.
There are mainly three setups to have a peer to peer network:
* unprotected ad-hoc interface by configuring the WiFi device
* unprotected ad-hoc interface using wpa_supplicant (Recommended)
* Only with suitable (RSN-IBSS capable) USB dongle:
* protected ad-hoc interface using wpa_supplicant and WPA encryption (best solution if possible)
* ad-hoc interface with additional USB/WiFi dongle for uplink to internet router
3 years ago
== Install prerequisites
3 years ago
[source,sh]
----
3 years ago
sudo apt-get install apt-transport-https ca-certificates software-properties-common -y
3 years ago
----
3 years ago
== Download and install Docker.
* *sudo su* # if not already done
3 years ago
[source,sh]
----
3 years ago
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
usermod -aG docker pi
curl https://download.docker.com/linux/raspbian/gpg
3 years ago
----
3 years ago
== Give the ‘pi’ user the ability to run Docker.
3 years ago
[source,sh]
----
3 years ago
sudo usermod -aG docker pi
3 years ago
----
3 years ago
== Import Docker and swarmlab.io keys
3 years ago
[source,sh]
----
3 years ago
curl https://download.docker.com/linux/raspbian/gpg
cat > /root/get-certs-swarmlab <<'EOF'
registry_address=hub.swarmlab.io
registry_port=5443
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
3 years ago
3 years ago
registry_port=5480
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
EOF
3 years ago
3 years ago
chmod +x /root/get-certs-swarmlab
/root/get-certs-swarmlab
3 years ago
----
3 years ago
== Add the Docker Repo.
3 years ago
[source,sh]
----
3 years ago
echo "deb https://download.docker.com/linux/raspbian/ buster stable" >> /etc/apt/sources.list
3 years ago
----
3 years ago
== Update your Pi.
3 years ago
[source,sh]
----
3 years ago
apt-get update
apt-get upgrade
3 years ago
----
3 years ago
== Start the Docker service.
3 years ago
[source,sh]
----
3 years ago
systemctl enable docker.service
systemctl start docker.service
3 years ago
----
3 years ago
== Verify that Docker is installed and running.
3 years ago
[source,sh]
----
3 years ago
docker info
docker ps
3 years ago
----
3 years ago
== install docker-compose
[source,sh]
----
apt-get install libffi-dev libssl-dev
apt install python3-dev
apt-get install -y python3 python3-pip
----
*python3* and *pip3* are installed, we can install Docker-Compose using the following command:
[source,sh]
----
pip3 install docker-compose
----
=== check it
docker-compose --version
docker-compose => 1.27.4
3 years ago
3 years ago
== Fix "x509: certificate signed by unknown authority" issue
3 years ago
3 years ago
* On Error:
3 years ago
3 years ago
Get https ://registry.vlabs.uniwa.gr:5080/v2/: x509: certificate
3 years ago
3 years ago
Pulling ...
ERROR: Get https://registry.vlabs.uniwa.gr:5080/v2/: x509: certificate signed by unknown authority
3 years ago
3 years ago
http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/install/install-docker.html#fix-x509-certificate-signed-by-unknown-authority-issue[See here^]
3 years ago
3 years ago
or simple run:
3 years ago
[source,sh]
----
3 years ago
/root/get-certs-swarmlab
3 years ago
----
3 years ago
== Reboot
3 years ago
3 years ago
NOTE: reboot
3 years ago