First, Brief introduction
Cadvisor: is a monitoring tool that Google uses to monitor the resource information of a single node and is often used as a for other monitoring.
InfluxDB: is an open source, time-series database with no external dependencies. Applies to recording metrics, events, and performing analysis.
Grafana: is a visualization panel (Dashboard), with very beautiful charts and layouts, a full-featured metric panel and graphic editor, supporting Graphite, Zabbix, InfluxDB, Prometheus and Opentsdb as data sources.
Ii. Building a container
[[email protected] ~]# docker network create monitor #构建监控用网络
(1), Influxdb
(2), cadvisor
docker run -d --name=cadvisor --net monitor -p 8090:8080 --mount type=bind,src=/,dst=/rootfs,ro --mount type=bind,src=/var/run,dst=/var/run --mount type=bind,src=/sys,dst=/sys,ro --mount type=bind,src=/var/lib/docker/,dst=/var/lib/docker,ro google/cadvisor -storage_driver=influxdb -storage_driver_db=cadvisor \ #influxdb中的数据库,之后创建-storage_driver_host=influxdb:8086 #因为在一个网络里,可以使用influxdb:8086
(3), Grafana
docker run -d --name grafana --net monitor -p 3000:3000 grafana/grafana
Third, the relevant configuration
(1) INFLUXDB configuration:
游览器访问:我的是http://192.168.100.126:8083
1. Create database used by Cadvisor: "Cadvisor"
2, create Grafana database users, creating user "Grafana" with PASSWORD ' Grafana '
(2) Grafana configuration:
游览器访问:我的是http://192.168.100.126:3000
1, the default account password is Admin:admin
2. Add Data Source: (Add the previously created influxdb):
3, configure the monitoring chart, take graph as an example, simple configuration can see the effect:
This is the use of the official dashboard show Prometheus map? (^?^*) (then share it accordingly).
Docker monitoring for rapid deployment, Cadvisor+influxdb+grafana