Collectd+InfluxDB+Grafana监控系统搭建

环境配置

节点配置类型操作系统
Sched2G 2CPU 50GB ens3=>192.168.200.11KVM虚拟机CentOS 7
Nova4G 2CPU 50GB ens3=>192.168.2000.12KVM虚拟机CentOS 7

Nova节点配置

安装Collectd

# yum install epel-release
# yum makecache
# yum install collectd -y
# systemctl start collectd
# systemctl enable collectd

配置Collectd

# vim /etc/collectd.conf
LoadPlugin network
<Plugin network>
        <Server "192.168.200.11" "25826">
        </Server>
</Plugin>
# systemctl restart collectd
# scp /usr/share/collectd/types.db root@192.168.200.11:~/

Sched节点配置

配置软件源

# 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 makecache

安装InfluxDB

# yum install influxdb -y

### 设置开机启动
# systemctl start influxdb
# systemctl enable influxdb

### 查询InfluxDB默认配置
# influxd config

### 如果不是使用标准的默认目录,需要手动修改目录权限
# chown -R influxdb:influxdb /mnt/influx
# chown -R influxdb:influxdb /mnt/db

配置InfluxDB

# mkdir -p /usr/share/collectd/
# mv types.db /usr/share/collectd/
# vim /etc/influxdb/influxdb.conf
[[collectd]]
  enabled = true
  bind-address = "0.0.0.0:25826"

### 查询配置是否生效
# influxd config
# systemctl restart influxdb
# systemctl stop firewalld
# systemctl disable firewalld

### 查询数据插入是否正常
> SHOW DATABASES
name: databases
name
----
_internal
collectd

> use collectd
Using database collectd
> 

安装Grafana

# yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x86_64.rpm

### 设置开机启动
# systemctl daemon-reload
# systemctl start grafana-server
# systemctl status grafana-server
# systemctl enable grafana-server

### 访问http://192.168.200.11:3000/login,默认用户名密码admin:admin,默认配置信息可查询/etc/grafana/grafana.ini文件

配置Grafana

### 数据库默认用户名密码root:root

配置数据源

661136-20171014115415668-1351970673.jpg

配置控制面板

661136-20171014115442715-1608195217.png

添加表格到控制面板

661136-20171014115504074-1692961870.png

配置表格显示规则

661136-20171014115549355-93755553.png

设置查询规则

661136-20171014115609590-728078097.png

保存控制面板

661136-20171014115619105-118945226.png

参考文档

InfluxDB官方文档

Grafana官方文档

Grafana+InfluxDB配置

转载于:https://www.cnblogs.com/silvermagic/p/7666306.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值