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:
		
							
								
								
									
										25
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								README.md
									
									
									
									
									
								
							@@ -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,16 +30,28 @@ 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)
 | 
			
		||||
 | 
			
		||||
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 
 | 
			
		||||
* Click the `Grafana` Menu at the top left corner (looks like a fireball)
 | 
			
		||||
@@ -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
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user