glances+influxdb+granfana打造服务器监控系统
文章目录

服务监控就是你的眼睛,当你对服务器运行状况一无所知时,你应该感到坐立不安。
<!--more-->
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 ,可显示如下代表目前一切正常

granfana安装
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

博客内容遵循 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议

请我喝杯咖啡
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论