russmckendrick / monitoring-docker

GNU General Public License v2.0
11 stars 16 forks source link

vagrant-ubuntu-chapter03-prometheus.yml #2

Closed lindison closed 8 years ago

lindison commented 8 years ago

Russ,

Thank you for the excellent "Monitoring Docker" book, it helps connect a lot of dots. I'm still working through the book, I came across the following and wanted to inform you. I came across an issue with what I believe to be in the vagrant-ubuntu. The problem seems to be that the prometheus.yml in Chapter03 is a directory, not the yml file.

how to produce

build initial prometheus and get error "[8] System error: not a directory"

vagrant@docker:/$ docker run \

--detach=true \ --volume=/monitoring_docker/Chapter03/prometheus.yml:/etc/prometheus/prometheus.yml \ --publish=9090:9090 \ --name=prometheus \ prom/prometheus:latest Unable to find image 'prom/prometheus:latest' locally latest: Pulling from prom/prometheus b98ffa2251d3: Pull complete a1a6b014b00f: Pull complete 21be5844b776: Pull complete 607817544848: Pull complete 1544eacbf482: Pull complete 69d8d15eecdd: Pull complete f1ef007f93d6: Pull complete d99646e9087a: Pull complete d7f59fd46ecc: Pull complete c7b26d04e72f: Pull complete 356f72ee258f: Pull complete 344809e13a9b: Pull complete 6c5dafe25dde: Pull complete Digest: sha256:a19a14f2db36dc6f26dd7c100874d7233df6c3abd3397ff50f59c0936a11db4d Status: Downloaded newer image for prom/prometheus:latest 01dd49b512e69268308d984947f86561ca4d9531267d4a08e732ac5fcd4afc05 Error response from daemon: Cannot start container 01dd49b512e69268308d984947f86561ca4d9531267d4a08e732ac5fcd4afc05: [8] System error: not a directory

validate prometheus.yml is a directory

vagrant@docker:/monitoring_docker$ cd Chapter03 vagrant@docker:/monitoring_docker/Chapter03$ ls prometheus.yml vagrant@docker:/monitoring_docker/Chapter03$ cat prometheus.yml/ cat: prometheus.yml/: Is a directory

delete directory and cp prometheus.yml

vagrant@docker:/monitoring_docker/Chapter 03$ rm -R /monitoring_docker/Chapter03/prometheus.yml vagrant@docker:/monitoring_docker/Chapter 03$ cp prometheus.yml /monitoring_docker/Chapter03/

delete old container

vagrant@docker:/$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 01dd49b512e6 prom/prometheus:latest "/bin/prometheus -con" 3 minutes ago Created prometheus

vagrant@docker:/$ docker rm 01dd

rebuild container

vagrant@docker:/$ docker run --detach=true --volume=/monitoring_docker/Chapter03/prometheus.yml:/etc/prometheus/prometheus.yml --publish=9090:9090 --name=prometheus prom/prometheus:latest e3ee089e7960a972c0e6904d22a029172731622e8dbf0c1c85cc83e99767005b

After this, the container came up and was able to get to the web UI.

lindison commented 8 years ago

apologies; this works https://github.com/russmckendrick/monitoring-docker, the issue was I pulled the book code from packtpub.