Skip to content

Latest commit

 

History

History
137 lines (88 loc) · 2.79 KB

00-cluster.md

File metadata and controls

137 lines (88 loc) · 2.79 KB

Cluster

1. Prerequisites

1.1. NFS Share

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

1.2. Floating IP

  • 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

2. Create the Cluster

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 and m2 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

3. Reverse Proxy

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

4. Cluster Management GUI

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

5. Private Registry

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