21 Telegraf_采集Mysql数据

实验环境:
106.12.88.74 ----> influxdb 1.7.6
106.12.88.228 ---> Grafana 6.2.2.1
119.3.92.176------> Telegraf 1.11.5-1 Mysql 5.7.21
+++++++++++++++++++++++++++++++++
119.3.92.176 安装 Telegraf 1.11.5-1
wget 'https://dl.influxdata.com/telegraf/releases/telegraf-1.11.5-1.x86_64.rpm'
yum localinstall telegraf-1.11.5-1.x86_64.rpm -y
启动:
systemctl start telegraf
systemctl enable telegraf
++++++++++++++++++++++++++++
Telegraf 采集Mysql 数据
需要在mysql 中,创建一个用户,并授权,用于访问mysql 的 status信息 119.3.92.176 上面操作

修改telegraf 配置文件:
vim /etc/telegraf/telegraf.conf


重启telegraf systemctl restart telegraf
106.12.88.228--->grafana 查看数据:


106.12.88.228 ---> Grafana 6.2.2.1 配置
复制前面创建好的 nginx 监控,就行修改。
















在119.3.92.176 上面,运行一个脚本,模拟数据访问。