The first things that is required on every node that compose the cluster is to link them to the NFS server to allow data sharing.
- Install required packages :
$> sudo apt-get install -y nfs-common
- Create the shared directory :
$> sudo mkdir -p /mnt/nfs
- Mount the directory from the NFS server :
$> sudo mount 192.168.1.200:/mnt/nfs /mnt/nfs
- Automatically mount the NFS share at boot time :
$> sudo nano /etc/fstab
# Add this line at the end of the file :
192.168.1.200:/mnt/nfs /mnt/nfs nfs rw 0 0
- Copy required files :
TODO
- Edit the network interface configuration file :
$> sudo nano /etc/network/interfaces.d/eth0
- Add the following configuration to the end of the file :
auto eth0:1
iface eth0:1 inet static
address 192.168.1.100
netmask 255.255.255.0
- Enable the the floating IP :
$> sudo ifup eth0:1
Following steps must be done only on the
m0
node. See setup for more information.
- Initialize the swarm :
$> docker swarm init --advertise-addr <@IP_of_leader_master_node>
- Obtain the join command for
manager
nodes :
$> docker swarm join-token manager
- Obtain the join command for
worker
nodes :
$> docker swarm join-token worker
Following steps must be done only on
m1
andm2
nodes. See setup for more information.
- Join the swarm as a manager node :
$> docker swarm join \
--token <generated_token> \
<@IP_of_leader_master_node>:2377
Following steps must be done only on every wx nodes. See setup for more information.
- Join the swarm as a worker node :
$> docker swarm join \
--token <generated_token> \
<@IP_of_leader_master_node>:2377
The chosen tool is Traefik.
Following steps must be done only on on of the mx node. See setup for more information.
- Deploy the stack :
$> docker stack deploy -c /mnt/nfs/stacks/docker-stack-proxy.yml proxy
The chosen tool is Portainer.
Following steps must be done only on on of the mx node. See setup for more information.
- Deploy the stack :
$> docker stack deploy -c /mnt/nfs/stacks/docker-stack-portainer.yml portainer
Following steps must be done only on on of the mx node. See setup for more information.
- Deploy the stack :
$> docker stack deploy -c /mnt/nfs/stacks/docker-stack-registry.yml registry