Public | Automated Build

Last pushed: 6 months ago
Short Description
Collectd
Full Description

Create network


docker network create -d overlay collectd

Create collectd service globally on all hosts


docker service create --name cagent --mode global \
--network collectd \
--env GRAPHITE_SERVER=graphite \
--env PLUGINS="docker write_graphite" \
--label service_name="docker-statistics" \
--mount type=volume,source=COLLECTD_AGENT,target=/DATA,volume-driver=local \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
--mount type=bind,src=/etc/timezone,dst=/etc/timezone,readonly  \
--mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly \
frjaraur/collectd agent

Create collectd service globally on all host to collect host metrics

Don't forget to set service/task/container hostname mounting docker host hostname inside

using --mount type=bind,src=/etc/hostname,dst=/etc/hostname,readonly ##


docker service create --name chost --mode global \
--network collectd \
--env GRAPHITE_SERVER=graphite \
--env PLUGINS="load memory write_graphite" \
--label service_name="docker-statistics" \
--mount type=volume,source=COLLECTD_AGENT,target=/DATA,volume-driver=local \
--mount type=bind,src=/etc/timezone,dst=/etc/timezone,readonly  \
--mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly  \
--mount type=bind,src=/etc/hostname,dst=/etc/hostname,readonly  \
frjaraur/collectd host

Create a graphite service to collect all node data regarding to containers


docker service create --name graphite \
   --network collectd \
   --publish 8080:80 --env RRDDIR=/DATA/collectd/rrd \
  --label service_name="Graphite" \
  --mount type=volume,source=GRAPHITE,target=/var/lib/graphite/storage/whisper,volume-driver=local \
  --mount type=bind,src=/etc/timezone,dst=/etc/timezone,readonly  \
  --mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly  \
  frjaraur/graphite start

We can even test a stress container


docker service create --name stress frjaraur/stress --cpu 1 --io 2 --vm 1 --vm-bytes 256M

For demo purposes we can just use make demo to create all previously describe infrastructure and make demo_clean for cleaning

NOTE: This will create just one volume for agent data (rrdcache will need separated ones, but this is just a demo...)

Docker Pull Command
Owner
frjaraur
Source Repository

Comments (0)