赞
踩
docker run --name prometheus -d \
-p 9090:9090 \
-v /etc/localtime:/etc/localtime:ro \
-v /home/docker/prometheus/data:/prometheus/data \
-v /home/docker/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml \
-v /home/docker/prometheus/rules:/prometheus/rules \
prom/prometheus:v2.41.0 --config.file=/prometheus/config/prometheus.yml
yml
global: scrape_interval: 15s scrape_timeout: 10s evaluation_interval: 1s alerting: alertmanagers: - static_configs: - targets: [] scheme: http timeout: 10s api_version: v1 scrape_configs: - job_name: prometheus honor_timestamps: true scrape_interval: 15s scrape_timeout: 10s metrics_path: /metrics scheme: http static_configs: - targets: - localhost:9090 - job_name: nacos honor_timestamps: true scrape_interval: 15s scrape_timeout: 10s metrics_path: /nacos/actuator/prometheus scheme: http static_configs: - targets: - 10.12.12.200:8848 - job_name: linux honor_timestamps: true scheme: http static_configs: - targets: - 10.12.12.200:9100 - job_name: cadvisor static_configs: - targets: - 10.12.12.200:18081 - job_name: mysql static_configs: - targets: - 10.12.12.200:9104
自行修改yml然后重启服务
docker run -d \
-p 3000:3000 \
--name=grafana \
-v /etc/localtime:/etc/localtime:ro \
-v/home/docker/grafana/data:/var/lib/grafana \
-v /home/docker/grafana/plugins/:/var/lib/grafana/plugins \
-v /home/docker/grafana/config/grafana.ini:/etc/grafana/grafana.ini \
-e "GF_SECURITY_ADMIN_PASSWORD=admin" \
-e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,grafana-piechart-panel" \
grafana/grafana:9.3.2
配置中文 (配置文件改完重启服务)
default_locale = zh-Hans
Mysql 7362
Linux 12633
Docker 193
nacos 下载地址
模板太多自行百度。
gement.endpoints.web.exposure.include=*
配置完nacos重启服务
下面测试是否配置和正确
http://10.12.12.200:9090/targets
docker run -d --name mysql-exporter \
-p 9104:9104 \
-v /home/docker/mysql_exporter/my.cnf:/etc/mysql/my.cnf prom/mysqld-exporter \
--config.my-cnf=/etc/mysql/my.cnf
配置文件自行更改
[client]
host=10.12.12.200
user=xhao
password=xhao@mysql
下面测试是否配置和正确
http://10.12.12.200:9090/targets
docker run -d --name node-exporter -p 9100:9100 -v "/proc:/host/proc:ro" -v "/sys:/host/sys:ro" -v "/:/rootfs:ro" prom/node-exporter
下面测试是否配置和正确
http://10.12.12.200:9090/targets
docker run -d \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
google/cadvisor:latest
下面测试是否配置和正确
http://10.12.12.200:9090/targets
如果点赞多,评论多会更新详细教程,待补充。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。