Ninvfeng Blog

记录web开发中的所见所得

centos7 安装influxdb+telegraf+grafana 监控服务器

influxdb是一个时间序列数据库, 所有数据记录都会打上时间戳, 适合存储数字类型的内容

telegraf 可以用于收集系统和服务的统计数据并发送到influxdb

grafana 是一个界面非常漂亮, 可直接读取influxdb数据展示成各种图表的开源可视化web软件

1.png

  1. 安装并启动influxdb数据库
vim /etc/yum.repos.d/influxdb.repo

[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key

yum install influxdb
systemctl start influxdb
systemctl enable influxdb
  1. 安装 telegraf
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.7.4-1.x86_64.rpm
yum localinstall telegraf-1.7.4-1.x86_64.rpm
  1. 生成telegraf配置文件并启动监控
telegraf --input-filter cpu:mem:disk --output-filter influxdb config > /etc/telegraf/telegraf.conf
systemctl start telegraf
systemctl enable telegraf
  1. 安装grafana
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.3-1.x86_64.rpm
yum localinstall grafana-5.2.3-1.x86_64.rpm
systemctl start grafana-server
systemctl enable grafana-server

文章评论已关闭!