Unverified Commit a4972c5e authored by Carlos Eduardo's avatar Carlos Eduardo Committed by GitHub
Browse files

Update README.md

parent a62253a9
# A Prometheus & Grafana docker-compose stack for Raspberry Pi
Here's a quick start for a Raspberry Pi monitoring stack containing [Prometheus](http://prometheus.io/), Grafana, cAdvisor and Node scraper to monitor your Docker infrastructure.
Here's a quick start for an ARM monitoring stack containing [Prometheus](http://prometheus.io/), Grafana, cAdvisor and Node scraper to monitor your Docker infrastructure. The images used are multi-arch for ARM32 and ARM64 and correctly fetched from DockerHub using metadata from your archtecture.
# Pre-requisites
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.
sudo apt-get update && sudo apt-get upgrade
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
sudo apt-get install docker-compose
Before we get started installing the Prometheus stack. Ensure you [install](https://docs.docker.com/install/#server) the latest version of docker ~~and [docker swarm](https://docs.docker.com/engine/swarm/swarm-tutorial/)~~ on your Docker host machine.
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
add-apt-repository \
"deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) \
stable"
sudo apt-get update -y
sudo apt-get install -y docker-ce
sudo usermod -aG docker $USER
Install docker-compose
apt-get install -qy python-pip --no-install-recommends
pip install pip --upgrade
pip install docker-compose
pip install --upgrade --force-reinstall docker-compose
# Installation & Configuration
Clone the project locally to your Docker host.
git clone https://github.com/carlosedp/arm-monitoring.git
cd arm-monitoring
This deployment uses XXXXXX to provide external accessible dashboards thru Traefik, in case external access is not needed, remove all references to Traefik from the `docker-compose.yml` file:
From `networks:` section, remove:
traefik:
external:
name: containermgmt_traefik
And from the Grafana and Portainer containers, remove the traefik labels and remove from `networks:` section:
- traefik
If you would like to change which targets should be monitored or make configuration changes edit the `/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.
Once configurations are done let's start it up. From the /prometheus project directory run the following command:
Once configurations are done let's start it up. From the cloned project directory run the following command:
docker-compose up -d
os in case of using Docker Swarm (not tested)
To check the containers:
$ HOSTNAME=$(hostname) docker stack deploy -c docker-compose.yml prom
docker-compose ps
That's it the `docker stack deploy' command deploys the entire stack automagically. By default cAdvisor and node-exporter are set to Global deployment which means they will propogate to every docker host attached to the Swarm.
os in case of using Docker Swarm (not tested)
The Grafana Dashboard is now accessible via: `http://<Host IP Address>:3000` for example http://192.168.10.1:3000
$ HOSTNAME=$(hostname) docker stack deploy -c docker-compose.yml prom
username - admin
password - admin (Password is stored in the `config.monitoring` env file)
That's it the `docker stack deploy` command deploys the entire stack automagically. By default cAdvisor and node-exporter are set to Global deployment which means they will propogate to every docker host attached to the Swarm.
In order to check the status of the newly created stack:
......@@ -44,7 +77,15 @@ View logs for a specific service
## Portainer
[Portainer](https://portainer.io/) is also installed as part of the stack. You can access it using the URL `http://<Host IP Address>:9000`
[Portainer](https://portainer.io/) is also installed as part of the stack. You can access it using the URL `http://<Host IP Address>:9000` for example http://192.168.10.1:9000, Portainer will ask to create a new user. For install details, check the [official site](https://portainer.io/install.html).
## Grafana
The Grafana Dashboard is now accessible via: `http://<Host IP Address>:3000` for example http://192.168.10.1:3000
username - admin
password - admin (Password is stored in the `config.monitoring` env file)
## Post Configuration
Create the Prometheus Datasource in order to connect Grafana to Prometheus
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment