1. updated README to default to using docker stack deploy instead of docker-compose

2. Removed deprecated expose from compose file
3. Bumped compose version to 3.2

Merge branch 'version-2' of github.com:vegasbrianc/prometheus into version-2

Signed-off-by: Brian Christner <brian.christner@gmail.com>
This commit is contained in:
Brian Christner 2017-10-18 21:19:00 +02:00
commit 83bc70cc76
No known key found for this signature in database
GPG Key ID: 8453AD0CB29591D1
2 changed files with 21 additions and 18 deletions

View File

@ -15,14 +15,13 @@
- [Troubleshooting](#troubleshooting)
- [Mac Users](#mac-users)
- [Interesting Projects that use this Repo](#interesting-projects-that-use-this-repo)
- [Swarm mode Configuration](#swarm-mode-configuration)
# A Prometheus & Grafana docker-compose stack
Here's a quick start to stand-up a [Prometheus](http://prometheus.io/) stack containing Prometheus, Grafana and Node scraper to monitor your Docker infrastructure. A big shoutout to [philicious](https://github.com/philicious) for kicking this project off!
# Pre-requisites
Before we get started installing the Prometheus stack. Ensure you install the latest version of docker and [docker-compose](https://docs.docker.com/compose/install/) on your Docker host machine. This has also been tested with Docker for Mac and it works well.
Before we get started installing the Prometheus stack. Ensure you install the latest version of docker and [docker swarm](https://docs.docker.com/engine/swarm/swarm-tutorial/) on your Docker host machine. Docker Swarm is installed automatically when using Docker for Mac or Docker for Windows.
# Installation & Configuration
Clone the project locally to your Docker host.
@ -31,15 +30,27 @@ If you would like to change which targets should be monitored or make configurat
Once configurations are done let's start it up. From the /prometheus project directory run the following command:
$ docker-compose up -d
$ docker stack deploy -c docker-compose.yml prome
That's it. docker-compose builds the entire Grafana and Prometheus stack automagically.
That's it the `docker stack deploy' command deploys the entire Grafana and Prometheus stack automagically to the Docker Swarm. By default cAdvisor and node-exporter are set to Global deployment which means they will propogate to every docker host attached to the Swarm.
The Grafana Dashboard is now accessible via: `http://<Host IP Address>:3000` for example http://192.168.10.1:3000
username - admin
password - foobar (Password is stored in the `config.monitoring` env file)
username - admin
password - foobar (Password is stored in the `config.monitoring` env file)
In order to check the status of the newly created stack:
$ docker stack ps prom
View running services:
$ docker service ls
View logs for a specific service
$ docker service logs prom_<service_name>
## Post Configuration
Now we need to create the Prometheus Datasource in order to connect Grafana to Prometheus
@ -114,9 +125,3 @@ Several projects utilize this Prometheus stack. Here's the list of projects:
*Have an intersting Project which use this Repo? Submit yours to the list*
# Swarm mode Configuration
Edit file `docker-compose.yml` change `node.hostname = <hostname where alertmanager or Prometheus config files are>` to your swarm node name for both `alertmanager` and `prometheus`
```
docker stack deploy -c docker-compose.yml monitor
```

View File

@ -21,8 +21,6 @@ services:
- '-alertmanager.url=http://alertmanager:9093'
- '-web.console.libraries=/usr/share/prometheus/console_libraries'
- '-web.console.templates=/usr/share/prometheus/consoles'
expose:
- 9090
ports:
- 9090:9090
links:
@ -54,8 +52,8 @@ services:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"'
expose:
- 9100
ports:
- 9100:9100
networks:
- back-tier
restart: always
@ -85,8 +83,8 @@ services:
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
expose:
- 8080
ports:
- 8080:8080
networks:
- back-tier
restart: always