1.配置数据导出的镜像:

docker run -d -p 9100:9100   -v "/proc:/host/proc:ro"   -v "/sys:/host/sys:ro"   -v "/:/rootfs:ro"   --net="host"   prom/node-exporter

部署成功后调用地址:http://192.168.1.225:9100/metrics

2.部署普罗米修斯的镜像:
首先将设置配置

mkdir -p /opt/prometheus
vi /opt/prometheus/prometheus.yml
global:
  scrape_interval:     30s
  evaluation_interval: 30s

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets: ['localhost:9090']
        labels:
          instance: prometheus

  - job_name: linux
    static_configs:
      - targets: ['192.168.1.225:9100']
        labels:
          instance: 192.168.1.225_linux

启动并拉取相关镜像

docker run  -d \
  -p 9090:9090 \
  -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml  \
  prom/prometheus

部署成功后的调用地址:http://192.168.1.225:9090/graph

3.配置grafana可视化界面:
生成配置配置文件

mkdir -p /opt/grafana_data
chmod 777 -R /opt/grafana_data

启动并拉取相关镜像

docker run -d \
  -p 3000:3000 \
  --name=grafana \
  -v /opt/grafana_data:/var/lib/grafana \
  grafana/grafana

http://192.168.1.225:3000/
login with admin/admin

Q.E.D.