Explore and Monitor Applications Running on Docker Swarm

Prerequisites:

  • Docker Community Edition 17.09.0-ce or newer
  • Docker Enterprise Edition 17.06.2-ee-3 or newer
  • A Docker Swarm cluster with at least one manager and a worker node

If you are using Docker Swarm, then you can install the Explore and Monitor agents all at once to your cluster. In Docker Swarm, the Weave Cloud Agents run as global services in the weave network in your cluster.

Install the Weave Cloud agents by running the following command on a Swarm manager node:

docker run -it --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    weaveworks/swarm-agents install [service-token]

Where,

The Weave stack is composed of the following services:

  • Explore agent (global service)
  • Monitor agent (Prometheus with remote write to Weave Cloud)
  • Node Exporter (global service)
  • cAdvisor (global service)

The Explore agent needs to run with privileged mode and because Swarm services don’t support privileged mode we are using a one-shot service that will provision each node with an Weave Explore container. The Weave Explore service will install Scope on each server and will exit. Using --restart-condition none we instruct Docker Swarm not to restart the service after it exits. With --mode global we make sure Weave Explore will be automatically deployed on new servers as you add them to the swarm.

Once the Weave Explore containers are running on all hosts you can login into Weave Cloud and inspect your cluster. Go to https://cloud.weave.works and click Explore from your instance.

The Monitor agent collects metrics from all Docker Swarm nodes and services in your cluster. Weave Cloud extends Prometheus by providing a distributed, multi-tenant, horizontally scalable version of Prometheus. It hosts the scraped Prometheus metrics for you, so that you don’t have to worry about storage or backups. Go to https://cloud.weave.works and click Monitor from your instance.