Skip to content

Instantly share code, notes, and snippets.

@fishnix
Last active January 30, 2018 10:49
Show Gist options
  • Save fishnix/a65a241ffa4856f54efc350162a80bc8 to your computer and use it in GitHub Desktop.
Save fishnix/a65a241ffa4856f54efc350162a80bc8 to your computer and use it in GitHub Desktop.
Create local NFS volume for influxdb service in docker swarm
docker network create --attachable --driver overlay data
docker volume create --driver local \
  --opt type=nfs  --opt o=addr=192.168.1.17,rw \
  --opt device=:/volume1/docker/influxdb influxdb
docker service create --name influxdb \
  -p 8086:8086 \
  --mount "type=volume,source=influxdb,destination=/var/lib/influxdb/,readonly=false" \
  --network data \
  --replicas 1  influxdb
docker service create --name mqtt \
-p 1883:1883 -p 9001:9001 --network data \
pascaldevink/rpi-mosquitto
docker volume create --driver local \
  --opt type=nfs  --opt o=addr=192.168.1.17,rw \
  --opt device=:/volume1/docker/telegraf telegraf
docker service create --name telegraf-sensors \
  --mount "type=volume,source=telegraf,destination=/etc/telegraf,readonly=true" \
  --network data \
  --replicas 1  telegraf
docker volume create --driver local \
  --opt type=nfs --opt o=addr=192.168.1.17,rw \
  --opt device=:/volume1/docker/grafana grafana
docker service create --name grafana \
  -p 3000:3000 \
  --mount "type=volume,source=grafana,destination=/var/lib/grafana/,readonly=false" \
  --network data \
  --replicas 1 fg2it/grafana-armhf:v4.6.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment