collectd
安裝
yum -y install epel-release
yum -y install collectd
配置
vi /etc/collectd.conf
Hostname "docker-1"
FQDNLookup true
Interval 10
Timeout 4
LoadPlugin network
<Plugin network>
Server "172.16.114.201" "25826"
</Plugin>
啟動(dòng)
systemctl start collectd.service
systemctl enable collectd.service
influxdb
配置yum
cat <<EOF | sudo tee /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
EOF
安裝
yum install influxdb
啟動(dòng)
systemctl start influxdb
systemctl enable influxdb
創(chuàng)建庫
influx
CREATE DATABASE collectd
use collectd
CREATE USER "root" WITH PASSWORD 'root' WITH ALL PRIVILEGES
配置
vi /etc/influxdb/influxdb.conf
hostname = "172.16.114.201"
[[collectd]]
enabled = true
bind-address = "172.16.114.201:25826"
database = "collectd"
#retention-policy = ""
#/usr/share/collectd/types.db這個(gè)文件放可,安裝collectd之后才會(huì)有雁刷,沒有這個(gè)文件時(shí)科雳,打開了這個(gè)配置泽谨,influx是啟動(dòng)不了的
typesdb = "/usr/share/collectd/types.db"
重啟
systemctl restart influxdb
查看25826這個(gè)端口是否已經(jīng)監(jiān)聽兔毒,如果有咖楣,則代表啟動(dòng)正常
[root@localhost influxdb]# netstat -anp| grep 25826
udp 0 0 172.16.114.201:25826 0.0.0.0:* 125967/influxd
Grafana
下載
需要FQ等龙,地址為https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm
安裝
rpm -ivh grafana-2.6.0-1.x86_64.rpm
啟動(dòng)
systemctl enable grafana-server
systemctl start grafana-server
訪問
http://172.16.114.201:3000/
用戶名:root
密碼:root
配置數(shù)據(jù)源
3CC39BC7-661D-4EE3-B719-7BEEE0A130BA.png