
监控完全体 = Prometheus + Node Exporter + cadvisor + grafana
Prometheus 作为轮转数据库,从各个服务器采集数据; node-exporter 作为数据采集器,接受 prometheus 采集请求,上报主机各项参数; vadvisor 作为容器数据采集器,接受 prometheus 采集请求,上报主机 docker 各项参数; grafana 作为看板,从 prometheus 查询数据做数据可视化。
部署 Promoetheus
准备配置文件 /data/docker/prometheus/prometheus.yml
CodeBlock Loading...
准备数据文件夹,并设置访问权限为 nobody
CodeBlock Loading...
启动 prometheus
CodeBlock Loading...
部署 Node Exporter 采集主机数据
可采用编译安装或包管理器直接安装。
编译安装
CodeBlock Loading...
Ubuntu 等直接安装:
CodeBlock Loading...
重载 prometheus 配置文件
CodeBlock Loading...
部署 cadvisor
CodeBlock Loading...
部署 grafana
CodeBlock Loading...
默认帐号: admin/admin
看板模版在这里找: https://grafana.com/grafana/dashboards/
参考文献
- 部署 Prometheus By monaive Gitbook
- Prometheus - book By yunlzheng Gitbook
- How to persist data in Prometheus running in a Docker container?
- Cannot launch with --web.enable-lifecycle #5986
- https://github.com/prometheus/prometheus/issues/5986#issuecomment-528290050
- 在运行时热加载Prometheus的配置信息
- How I monitor my OpenWrt router with Grafana Cloud and Prometheus
- 在运行时热加载Prometheus的配置信息
- 根据PID获取进程名&根据进程名获取PID【转】
- How to install Node Exporter on CentOS 7 - Linux Monitoring
- prometheus / node_exporter
- cadvisor docker container fails to start "mountpoint for cpu not found" (clearcontainers) #1943