当前位置:网站首页>【Prometheus】4. Monitoring cases
【Prometheus】4. Monitoring cases
2022-06-24 15:45:00 【Try something new for a long time】
monitor linux The server
node_exporter summary
node_exporter: be used for *NIX System monitoring , Use GO Collector for language development
Using document :https://prometheus.io/docs/guides/node-exporter/
Github:https://github.com/prometheus/node_exporter
exprot list :https://prometheus.io/docs/instrumenting/exporters/
Download and run node_exporter:
- download :wget https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-amd64.tar.gz
- decompression :tar -zxvf node_exporter-1.1.2.linux-amd64.tar.gz
- Move to the working directory :mv node_exporter-1.1.2.linux-amd64 /usr/local/node_exporter
- Configure for system service :
- vim /usr/lib/systemd/system/node_exporter.service
- systemctl daemon-reload
- systemctl start node_exporter
- netstat -antp | grep 9100
Configure through service discovery node_exporter
1. modify prometheus.yml
2. Add service discovery profile
3. Check the configuration file and restart prometheus
- ./promtool check config prometheus.yml
- kill -hup [pid]
monitor CPU, Memory , Hard disk
CPU Usage rate :
100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) by (instance)*100)
Memory usage :
100 - (node_memory_MemFree_bytes+node_memory_Cached_bytes+node_memory_Buffers_bytes) / node_memory_MemTotal_bytes * 100
Hard disk usage :
100 - (node_filesystem_free_bytes{mountpoint="/", fstype=~"ext4|xfs"} /node_filesystem_size_bytes{mountpoint="/", fstype=~"ext4|xfs"} * 100)
Monitoring service status
1. start-up node_exporter Service monitoring vim /usr/lib/systemd/system/node_exporter.service
2. Reload the configuration file systemctl daemon-reload
3. Restart the startup service systemctl restart node_exporter
4. View the restart results ps -ef | grep node_exporter
5. View service status
Use grafana Display monitoring data
grafana: Open source measurement analysis and visualization system , Initial password admin
Download address :https://grafana.com/grafana/download
More Kanban :https://grafana.com/dashboards
Usage method
1. docker install :docker run -d --name=grafana -p 3000:3000 grafana/grafana
2. Add data sources
3. Create dashboard
4. Import other dashboards
----
monitor docker The server
cAdvisor (Container Advisor) Used to collect running container resource usage and performance information ,go Language development
Download address :https://github.com/google/cadvisor
More Kanban :https://grafana.com/dashboards/193
Usage method :
1. install
docker run \ --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 \ --privileged \ --device=/dev/kmsg \ gcr.io/cadvisor/cadvisor:$VERSION
2. Check whether the startup is successful docker ps -l
3. Add to prometheus monitor
- modify prometheus The configuration file :
- Check prometheus Configuration file modification :./promtool check config prometheus.yml
- restart prometheus
- Import docker grafana The dashboard 193
边栏推荐
- 熬夜整理出的软件测试【高频】面试题大全(2022最新)
- Teach you how to deploy the pressure test engine on Tencent cloud
- Solution to the problem that FreeRTOS does not execute new tasks
- Vim编辑器的最常用的用法
- MySQL development specification
- Linux记录-4.22 MySQL5.37安装(补充)
- How to implement SQLSERVER database migration in container
- 期货公司开户安全吗
- A series of problems caused by IPVS connection reuse in kubernetes
- Parameterized tests guide in junit5
猜你喜欢

Why is it easy for enterprises to fail in implementing WMS warehouse management system

CAP:多重注意力机制,有趣的细粒度分类方案 | AAAI 2021

60 个神级 VS Code 插件!!

Three solutions for Jenkins image failing to update plug-in Center
![[C language questions -- leetcode 12 questions] take you off and fly into the garbage](/img/ca/a356a867f3b7ef2814080fb76b9bfb.png)
[C language questions -- leetcode 12 questions] take you off and fly into the garbage

实现领域驱动设计 - 使用ABP框架 - 领域逻辑 & 应用逻辑

Still worried about missing measurements? Let's use Jacobo to calculate the code coverage

熬夜整理出的软件测试【高频】面试题大全(2022最新)

Solution of intelligent all in one machine in expressway service area

Linux record -4.22 MySQL 5.37 installation (supplementary)
随机推荐
Precautions for using JMeter suite to build a pressure test environment
Design of vga/lcd display controller system based on FPGA (Part 2)
Universal file online preview project, open source!
设备通过国标GB28181接入EasyCVR平台,出现断流情况该如何解决?
QoS Technology in network
asciinema 搭配 asciicast2gif 实现高效的命令行终端录制能力
如何扩展aws主机上的磁盘空间
一文详解JackSon配置信息
Istio practical skill: enable accesslog locally
The future of robots -- deep space exploration
Apple is no match for the longest selling mobile phone made in China, and has finally brought back the face of the domestic mobile phone
【Kubernetes】1
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]
How to optimize performance
国产芯片的赶超,让美国手机芯片龙头高通害怕了,出招应对竞争
为什么企业实施WMS仓储管理系统很容易失败
Solution to the problem that FreeRTOS does not execute new tasks
Use dictionary
Efficient tools commonly used by individuals
Arrays API