服务监控就是你的眼睛,当你对服务器运行状况一无所知时,你应该感到坐立不安。
glances安装glances是由python编写的,因此可以使用pip直接安装
pip3 install glances
influxdb安装
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.2.x86_64.rpm
sudo yum localinstall influxdb-1.8.2.x86_64.rpm
收集数据到influxdb配置 glances
vim /etc/glances/glances.conf
[influxdb]
# Configuration for the --export influxdb option
# https://influxdb.com/
host=localhost
port=8086
user=root
password=root
db=glances
prefix=localhost
#tags=foo:bar,spam:eggs
pip3 install influxdb
glances --export influxdb
执行 glances --export influxdb
测试下,报错
InfluxDB database 'glances' did not exist. Please create it
需要新建数据库。
执行shell influx
CREATE DATABASE glances #创建数据
SHOW DATABASES # 查看数据库
再次执行glances --export influxdb
,可显示如下代表目前一切正常
wget https://dl.grafana.com/oss/release/grafana-7.1.5-1.x86_64.rpm
sudo yum install grafana-7.1.5-1.x86_64.rpm
启动
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server
systemctl enable grafana-server.service
配置数据源grafana 还支持zipkin
本文永久链接是:http://visonforcoding.github.io/2020/08/25/glances-influxdb-granfana%E6%89%93%E9%80%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9B%91%E6%8E%A7%E7%B3%BB%E7%BB%9F/
请我喝杯咖啡
原文地址:https://segmentfault.com/a/1190000023958666,作者:麦田348462402
以上就是对glances+influxdb+granfana打造服务器监控系统的相关介绍,希望对您学习有所帮助,感谢您关注懒咪IT学习网!
本文地址:https://c.lanmit.com/bianchengkaifa/Python/119935.html