influxDB + Grafana + Telegraf 监控安装

环境准备

下载

1.influxDB
官网下载release的新版
或者csdn下载influxDB下载地址
2.grafana

wget https://dl.grafana.com/oss/release/grafana-7.0.5-1.x86_64.rpm

官网下载速度极限慢
csdn下载地址grafana下载地址

3.telegraf
csdn下载telegraf下载地址

监控数据服务器安装

1.安装influxDB

yum localinstall influxdb-1.7.4.x86_64.rpm

设置开机启动和开始运行

systemctl enable influxdb
systemctl start influxdb

测试,可以进入influxdb则运行成功

[root@bogon ~]# influx
Connected to http://localhost:8086 version 1.7.4
InfluxDB shell version: 1.7.4
Enter an InfluxQL query
> 

2.安装grafana

yum localinstall grafana-6.2.5-1.x86_64.rpm

启动执行

systemctl restart grafana-server

测试,浏览器打开 所在服务器ip:3000
账户admin,密码admin可进入grafana面板

3.安装telegraf

yum localinstall telegraf-1.14.5-1.x86_64.rpm

编辑配置文件,设置接收数据的influxDB地址等

vim /etc/telegraf/telegraf.conf

重载配置,重启telegraf,查看执行状态

systemctl daemon-reload
systemctl restart telegraf
systemctl status telegraf

4.如果需要监控docker,需要修改telegraf权限

 vim /usr/lib/systemd/system/telegraf.service
[Unit]
Description=The plugin-driven server agent for reporting metrics into InfluxDB
Documentation=https://github.com/influxdata/telegraf
After=network.target

[Service]
EnvironmentFile=-/etc/default/telegraf
User=root # 此处原为telegraf,改为root后可监控docker
ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE
KillMode=control-group

[Install]
WantedBy=multi-user.target

你可能感兴趣的:(centos,服务器)