您的当前位置:首页正文

使用 Grafana、collectd 和 InfluxDB 打造现代监控系统

2023-11-10 来源:画鸵萌宠网

yum install collectd-rrdtool rrdtool rrdtool-devel

A note on UDP/IP OS Buffer sizes

sysctl net.core.rmem_max
sysctl -w net.core.rmem_max=8388608

influxdb 部署安装

yum 安装influxdb

[root@monitor501 yum.repos.d]# cat 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

yum install influxdb -y

创建clloectd 库及用户权限分配

终端输入 influxdb 进入influxdb数据CLI

create user collectd with password ‘redhat‘ WITH ALL PRIVILEGES

配置文件指明influxdb 使用 collectd 采集器

[[collectd]]
  enabled = true
   bind-address = "10.18.17.101:25826"
   database = "collectd"
   typesdb = "/usr/share/collectd/types.db"

influxdb collectd config

Please note that UDP packets larger than the standard size of 1452 are dropped at the time of ingestion. Be sure to set MaxPacketSize to 1452 in the collectd configuration.

Config Example
[[collectd]]
  enabled = true
  bind-address = ":25826" # the bind address
  database = "collectd" # Name of the database that will be written to
  retention-policy = ""
  batch-size = 5000 # will flush if this many points get buffered
  batch-pending = 10 # number of batches that may be pending in memory
  batch-timeout = "10s"
  read-buffer = 0 # UDP read buffer size, 0 means to use OS default
  typesdb = "/usr/share/collectd/types.db"

安装 grafana-server

饼图插件

grafana-cli plugins install grafana-piechart-panel

yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.3-1463994644.x86_64.rpm

Add the following to a new file at /etc/yum.repos.d/grafana.repo

[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

service grafana-server start #启动 默认登录账户admin 密码admin


本文出自 “天天linux” 博客,请务必保留此出处http://olamp.blog.51cto.com/2900940/1784492

使用 Grafana、collectd 和 InfluxDB 打造现代监控系统

标签:zabbix collectd influxdb grafana

Top