HJ3-24.7 性能监控体系实战

配置 Prometheus

  • Prometheus 是一款开源系统监控和警报工具。使用 Go 语言开发,有各种 exporter 用来收集服务器性能数据。
  • 我们通过Promethues 来监控压测时服务端的性能。

部署 Prometheus

  • 配置文件:https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml
  • 运行:
    docker run -d --name prometheus --network grafana -p 9090:9090 -v ${PWD}/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus:v2.16.0 --config.file=/etc/prometheus/prometheus.yml
    
./node_exporter --help
./node_exporter --web.listen-address=":9102"
nohup ./node_exporter --web.listen-address=":9102" &
cat nohup.out
vim prometheus.yml
- job_name:'CentOS 192.168.31.61'
  static_configs:
  - targets:['192.168.31.61:9102']
docker restart prometheus

配置 Grafana

https://grafana.com/grafana/dashboards/8919

cat /etc/redhat-release
yum install nginx
systemctl restart nginx

你可能感兴趣的:(HJ3-24.7 性能监控体系实战)