updated README for Mac Users and added a table of contents

This commit is contained in:
Brian Christner 2017-10-15 23:23:53 +02:00
parent abf7684761
commit fe6c9fa803
No known key found for this signature in database
GPG Key ID: 8453AD0CB29591D1
2 changed files with 29 additions and 8 deletions

View File

@ -1,13 +1,30 @@
[![Build Status](https://travis-ci.org/vegasbrianc/prometheus.svg?branch=version-2)](https://travis-ci.org/vegasbrianc/prometheus)
# Contents
- Introduction
- [Overview](#A-Prometheus-&-Grafana-docker-compose-stack)
- [Pre-requisites](#Pre-requisites)
- [Installation & Configuration](#Installation-&-Configuration)
- [Post Configuration](#Post-Configuration)
- [Alerting](#Alerting)
- [Test Alerts](#Test-Alerts)
- [Install Dashboard](#Install-Dashboard)
- [Security Considerations](#Security-considerations-for-production)
- [Security Considerations](#Security-considerations-for-production)
- [Troubleshooting](#Troubleshooting)
- [Mac Users](#Mac-Users)
- [Intesting Projects that use this Repo](#Intesting-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
# 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.
## Installation & Configuration
# Installation & Configuration
Clone the project locally to your Docker host.
If you would like to change which targets should be monitored or make configuration changes edit the [/prometheus/prometheus.yml](https://github.com/vegasbrianc/prometheus/blob/version-2/prometheus/prometheus.yml) file. The targets section is where you define what should be monitored by Prometheus. The names defined in this file are actually sourced from the service name in the docker-compose file. If you wish to change names of the services you can add the "container_name" parameter in the `docker-compose.yml` file.
@ -70,22 +87,25 @@ Here's the Dashboard Template
Grafana Dashboard - `dashboards/Grana_Dashboad.json`
Alerting Dashboard - `dashboards/System_Monitoring.json`
## Security Considerations
# Security Considerations
This project is intended to be a quick-start to get up and running with Docker and Prometheus. Security has not been implemented in this project. It is the users responsability to implement Firewall/IpTables and SSL.
Since this is a template to get started Prometheus and Alerting services are exposing their ports to allow for easy troubleshooting and understanding of how the stack works.
### Security considerations for production:
## Security considerations for production:
Here are just a couple security considerations for this stack to help you get started.
* Remove the published ports from Prometheus and Alerting servicesi and only allow Grafana to be accessed
* Enable SSL for Grafana with a Proxy such as [jwilder/nginx-proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) or [Traefik](https://traefik.io/) with Let's Encrypt
* Add user authentication via a Reverse Proxy [jwilder/nginx-proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) or [Traefik](https://traefik.io/) for services cAdvisor, Prometheus, & Alerting as they don't support user authenticaiton
* Terminate all services/containers via HTTPS/SSL/TLS
## Troubleshooting
# Troubleshooting
It appears some people have reported no data appearing in Grafana. If this is happening to you be sure to check the time range being queried within Grafana to ensure it is using Today's date with current time.
## Intesting Projects that use this Repo
## Mac Users
The node-exporter does not run the same as Mac and Linux. Node-Exporter is not designed to run on Mac and in fact cannot collect metrics from the Mac OS due to the differences between Mac and Linux OS's. I recommend you comment out the node-exporter section in the `docker-compose.yml` file and instead just use the cAdvisor.
# Intesting Projects that use this Repo
Several projects utilize this Prometheus stack. Here's the list of projects:
* [Docker Pulls](https://github.com/vegasbrianc/docker-pulls) - Visualize Docker-Hub pull statistics with Prometheus
@ -94,7 +114,7 @@ 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
# 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`
```

View File

@ -32,6 +32,7 @@ services:
- cadvisor
networks:
- back-tier
- host
restart: always
deploy:
placement:
@ -51,7 +52,7 @@ services:
expose:
- 9100
networks:
- host
- back-tier
restart: always
deploy:
mode: global