服务监控就是你的眼睛,当你对服务器运行状况无所不知时,你应该感到如坐针毡。
<!--more-->
glances装置
glances是由python编写的,因而能够应用pip间接装置
pip3 install glances
influxdb装置
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.2.x86_64.rpmsudo 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=localhostport=8086user=rootpassword=rootdb=glancesprefix=localhost#tags=foo:bar,spam:eggs
pip3 install influxdbglances --export influxdb
执行 glances --export influxdb
测试下,报错
InfluxDB database 'glances' did not exist. Please create it
须要新建数据库。
执行shell influx
CREATE DATABASE glances #创立数据SHOW DATABASES # 查看数据库
再次执行glances --export influxdb
,可显示如下代表目前一切正常
granfana装置
wget https://dl.grafana.com/oss/release/grafana-7.1.5-1.x86_64.rpmsudo yum install grafana-7.1.5-1.x86_64.rpm
启动
systemctl daemon-reloadsystemctl start grafana-serversystemctl status grafana-server systemctl enable grafana-server.service
配置数据源
grafana 还反对zipkin
博客内容遵循 署名-非商业性应用-雷同形式共享 4.0 国内 (CC BY-NC-SA 4.0) 协定本文永恒链接是: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/
请我喝杯咖啡