Prometheus monitoring related (docker method)

http://www.ywnds.com/?p=9668   (using Docker to install Prometheus)

 

1. Docker must be installed first, if you don’t know how to install docker-ce first

       Not clear, please see centOS7 installation using docker 

2. Install prometheus

        docker run --name=prometheus -d -p 9090:9090 -v /data/dockerdata/prometheus-data:/prometheus-data -v /data/dockerdata/prometheus-file/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus -config.file=/etc/prometheus/prometheus.yml

 

3. Install node_exporter

      docker run --name=node-exporter -d -p 9100:9100 -v "/proc:/host/proc:ro"  -v "/sys:/host/sys:ro"  -v "/:/rootfs:ro"  prom/node-exporter  --collector.procfs /host/proc  --collector.sysfs /host/sys    --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"

 

#If     you install it in docker mode, but do not set --net =host , you will not see the network card traffic and netstat content in Prometheus/Grafana .     

    docker   run  -d    \            

--net=host    \            

--restart=always  \            

--name  node-exporter     \            

-p    9100:9100    \            

-v    "/proc:/host/proc"      \            

-v    "/sys:/host/sys"   \            

-v    "/:/rootfs"     \             prom/node-exporter  \            

-collector.procfs  /host/proc    \            

-collector.sysfs    /host/sys       \            

-collector.filesystem.ignored-mount-points"^/(sys|proc|dev|host|etc)($|/)" 

 

4. Install cadvisor

       docker run -d --restart=always  --volume=/:/rootfs:ro   --volume=/var/run:/var/run:rw   --volume=/sys:/sys:ro   --volume=/var/lib/docker/:/var/lib/docker:ro   --volume=/dev/disk/:/dev/disk:ro   --publish=8090:8080   --detach=true   --name=cadvisor google/cadvisor:latest

 

5, cheap grafana

      docker run --name = grafana -d -p 3000: 3000 -e "GF_SECURITY_ADMIN_PASSWORD = admin" -v / data / dockerdata / grafana_db: / var / lib / grafana grafana / grafana

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326261245&siteId=291194637