wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.6.x86_64.rpm yum localinstall influxdb-1.7.6.x86_64.rpm systemctl start influxd
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.11.0-1.x86_64.rpm yum localinstall telegraf-1.11.0-1.x86_64.rpm
systemctl start telegraf
[root@localhost software]# influx Connected to http://localhost:8086 version 1.7.6 InfluxDB shell version: 1.7.6 Enter an InfluxQL query > create databese telegraf > create database jmeter > show databases name: databases name ---- _internal telegraf jmeter > CREATE USER root WITH PASSWORD '123456' WITH ALL PRIVILEGES # (建立一個新的管理員用戶) > GRANT ALL PRIVILEGES TO root #爲一個已有用戶受權管理員權限 > exit
[root@localhost software]# vi /etc/telegraf/telegraf.conf ## 修改內容以下 [[outputs.influxdb]] urls = ["http://localhost:8086"] #infulxdb地址 database = "telegraf" #數據庫 precision = "s" timeout = "5s" username = "admin" #賬號 password = "admin" #密碼 retention_policy = "" [root@VM_172_102_centos tools]# systemctl restart telegraf
## 狀態是running說明配置加載成功
[root@localhost software]# service telegraf status
Redirecting to /bin/systemctl status telegraf.service
?.telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-06-18 04:59:48 EDT; 9s ago
Docs: https://github.com/influxdata/telegraf
Main PID: 7429 (telegraf)
CGroup: /system.slice/telegraf.service
?..7429 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/teleg...
Jun 18 04:59:48 localhost.localdomain systemd[1]: Stopped The plugin-driven server agent for repo...DB.
Jun 18 04:59:48 localhost.localdomain systemd[1]: Started The plugin-driven server agent for repo...DB.
Jun 18 04:59:48 localhost.localdomain telegraf[7429]: 2019-06-18T08:59:48Z I! Starting Telegraf 1.11.0
Jun 18 04:59:48 localhost.localdomain telegraf[7429]: 2019-06-18T08:59:48Z I! Loaded inputs: cpu d...em
telegrfa默認開啓下列幾項系統性能收集,也能夠經過配置文件自定義收集應用服務性能數據git
安裝配置完後,進到influxdb的telegraf數據庫裏面能夠看到幾張表,以下:github
wget https://dl.grafana.com/oss/release/grafana-6.2.3-1.x86_64.rpm
yum localinstall grafana-6.2.3-1.x86_64.rpm
安裝完成後啓動服務:systemctl start grafana-server,service grafana-server restart(重啓),shell
記住要關閉防火牆喔,systemctl stop firewalld.service(臨時關閉)和systemctl disable firewalld.service(禁止開機啓動)systemctl status firewalld.service(查看防火牆狀態)數據庫
而後訪問,ip+3000端口,默認用戶名和密碼是admin;centos
經過命令getenforce來查看一下SELinux的狀態,bash
安裝好了grafana以後,咱們能夠配置一下grafana從influxdb中讀取數據,從設置->Data Sources而後進行以下的配置:dom