Professional Documents
Culture Documents
InfluxDB Go
v0.8.8
collectd C
InfluxDB
server 172.18.1.113
InfluxDB Grafana
Client 172.18.2.125
Collectd
server
influxdb
1 YUM
[influxdb]
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF
web http://172.18.1.113:8083/
API 172.18.1.113:8086
/etc/influxdb/influxdb.conf
grafana
1.RPM
#wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm
/var/log/grafana/grafana.log
/etc/grafana/grafana.ini
#vim /etc/grafana/grafana.ini
// 3000
http_port = 3001
#/etc/init.d/grafana-server restart
http://172.18.1.113:3001
Client
25826
#vim /etc/influxdb/influxdb.conf
[collectd]
enabled = true
bind-address = ":25826"
database = "collectd"
# https://github.com/collectd/collectd/blob/master/src/types.db
#types.db
typesdb = "/usr/share/collectd/types.db"
batch-size = 5000 # will flush if this many points get buffered
batch-timeout = "10s" # will flush at least this often even if we haven't hit buffer limit
read-buffer = 0 # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
influxdb
collectd
YUM
#vim /etc/collectd.conf
LoadPlugin load
LoadPlugin memory
LoadPlugin network
// network
<Plugin network>
</Plugin>
/etc/init.d/collectd restart
influxdb WEB
# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
name: databases
---------------
name
_internal
collectd
grafana
grafana
test connection
c
dashboard
Panel
[] collectd + InfluxDB + Grafana
RRD
MRTG CactiRRD
Cacti 24 :
24 :
RRD
collectd InfluxDB
Grafana
(IP 192.168.111.241)
InfluxDB
1 cat<<EOF>/etc/yum.repos.d/influxdb.repo
2 [influxdb]
4 baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
5 enabled = 1
6 gpgcheck = 1
7 gpgkey = https://repos.influxdata.com/influxdb.key
8 EOF
2.
cat<<EOF>/etc/firewalld/services/influxdb.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<service>
3
<short>InfluxDB</short>
4
<description>InfluxDB is an open source time series database with no external
5
dependencies. It's useful for recording metrics, events, and performing
6
analytics.</description>
7
<port protocol="tcp" port="8083"/>
8
<port protocol="tcp" port="8086"/>
9
</service>
10
EOF
11
chmod 600 /etc/firewalld/services/influxdb.xml
12
firewall-cmd --add-service=influxdb --permanent
firewall-cmd --reload
3. influx influxdb
2exit
4. influxdb http://192.168.111.241:8083
Grafana
1 cat<<EOF>/etc/yum.repos.d/grafana.repo
2 [grafana]
3 name=grafana
4 baseurl=https://packagecloud.io/grafana/stable/el/6/\$basearch
5 repo_gpgcheck=1
6 enabled=1
7 gpgcheck=1
8 gpgkey=https://packagecloud.io/gpg.key
9 https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
10sslverify=1
11sslcacert=/etc/pki/tls/certs/ca-bundle.crt
12EOF
2.
1 cat<<EOF>/etc/firewalld/services/grafana.xml
3 <service>
4 <short>Grafana</short>
5 <description>Grafana provides a powerful and elegant way to create, explore,
6 and share dashboards and data with your team and the world.</description>
8 </service>
9 EOF
firewall-cmd --reload
1. collectd
2. /etc/influxdb/influxdb.conf [[collectd]]
1enabled = false
1 enabled = true
4 retention-policy = ""
7 batch-timeout = "10s"
9 typesdb = "/usr/share/collectd/types.db"
10#enabled = false
3.
4.
1 cat<<EOF>/etc/firewalld/services/collectd.xml
3 <service>
4 <short>collectd</short>
7 </service>
8 EOF
10firewall-cmd --reload
5. influx influxdb
6exit
1. collectd
InfluxDB
?
1 cat<<EOF>/etc/collectd.d/network.conf
2 Hostname "grafana"
3 FQDNLookup false
4 LoadPlugin network
5 LoadPlugin uptime
6 <Plugin network>
8 </Plugin>
9 EOF
2. influxdb Database
collections
3. collections Query Templates Show Measurements
collectd
Grafana Dashboard
1. Grafana http://192.168.111.241:3000
2. admin / admin
3. admin
5. Url direct
http://localhost:8086 http://192.168.111.241:8086
o Name: Collectd
o Default:
o Type: InfluxDB
o Url: http://192.168.111.241:8086
o Access:direct
o Http Auth:
o Database: collections
o User: collectdread
o Password: readonly
9. System Information
X Dashboard
10. ROW Add Panel > Graph
12. Metrics A
13. Grafana Toggle Edit
Mode
14.
Dashboard
19. Dashboard System
Information Dashboard
Dashboard Templating
Metrics Dashboard
Grafana /
()
(InfluxDBGraphtie )