标签:info export grafana int gets 名称 图片 run nod
1 docker search prometheus 2 docker search node-exporter
1 docker pull prom/prometheus 2 docker pull prom/node-exporter
docker images
1 docker run -d -p 9100:9100 2 -v "/proc:/host/proc:ro" 3 -v "/sys:/host/sys:ro" 4 -v "/:/rootfs:ro" 5 --net="host" 6 prom/node-exporter
1、使用docker ps 查看容器是否启动
2、启动成功后,浏览器访问:http://localhost:9100/netrics,可以看到下图
1、增加目录,并修改prometheus.yaml 文件
1 mkdir /opt/prometheus 2 cd /opt/prometheus/ 3 vim prometheus.yml
2、在prometheus.yaml中,修改job_name为你自己需要的名称,在targets中填入该linux主机的地址(即部署了node-export的主机地址),确保prometheus所在主机能够访问到它。
global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. scrape_configs: - job_name: prometheus static_configs: - targets: [‘localhost:9090‘] labels: instance: prometheus - job_name:node1 static_configs: - targets: [‘192.168.0.2:9100‘] labels: instance: node1
3、创建并启动prometheus容器
docker run -id -p 9090:9090-v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
4、使用 docker ps 命令,确保容器运行后,浏览器访问 http://localhost:9090/targets,直接从Prometheus的UI中查看当前所有的任务以及每个任务对应的实例信息。
docker部署prometheus + node_export + grafana(上)
标签:info export grafana int gets 名称 图片 run nod
原文地址:https://www.cnblogs.com/sunshinefly/p/14392370.html