Steps to setting up Docker Swarm

      1. Create docker-machine in cloud (ie, Digital Ocean) to be key/value store
      2. Create docker-machine in cloud to be Swarm Master. Only ONE
      3. Create Slaves (simply docker-machines). Multiple OK
      4. All swarm nodes communicate on private network, eth1 (same data center)
      5. All Docker-Machines know about one another b/c of key/value store (consul)
      6. Hook up Docker Client to the Swarm to connect to it and control the swarm

First, Must set up key/value store (Consul or ZooKeeper)

      1. Key/Value Store gives Docker Swarm information on how each node (docker server is running).
      2. Also called Service Discovery
        1. how Swarm Manager keeps track of the state of all nodes in the cluster
          1. One way to track state is with a “key/value store”

Swarm supports Consul and Apache ZooKeeper

Screen Shot 2016-10-12 at 6.24.56 AM.png

More info on Consul (https://www.consul.io/)

Monitors how each server is running

Once all the servers have been set up and provisioned, they need to know about each other, and they need to be monitored. A tool that is well suited to do this in cloud environments is Consul.

It runs as a sidecar next to each service and monitors the service and the host it is running on.

Using Consul, the load balancer (nginx) will be aware of the different web servers it can forward requests to.

https://ahus1.github.io/saltconsul-examples/tutorial.html

Screen Shot 2016-10-11 at 1.22.48 PM.png

      1. Make our lives easier by first setting ENV variables from w/in terminal
        1. If new terminal session, likely have to redo this step
          1. To see ENV, run $ printenv VARIABLE_NAME
          2. To see all ENVs, run $ env
        2. $ export DIGITALOCEAN_ACCESS_TOKEN=<YOUR_DO_TOKEN>
        3. $ export DIGITALOCEAN_PRIVATE_NETWORKING=true
        4. $ export DIGITALOCEAN_IMAGE=debian-8-x64

results matching ""

    No results matching ""