当前位置:网站首页>使用华为HECS云服务器打造Telegraf+Influxdb+Grafana 监控系统【华为云至简致远】
使用华为HECS云服务器打造Telegraf+Influxdb+Grafana 监控系统【华为云至简致远】
2022-06-11 13:12:00 【华为云】
一 背景
在所有现有的现代监控工具中,TIG(Telegraf、InfluxDB和Grafana)可能是最受欢迎的工具之一。
该堆栈可用于监视大量不同的数据源:从操作系统(如Linux或Windows性能指标)到数据库(如MongoDB或MySQL),
Telegraf是一个负责收集和聚合数据的代理,例如当前的CPU使用情况。
InfluxDB将存储数据,并将其公开给Grafana,这是一种现代的仪表板解决方案。

本文利用华为HECS云服务器进行监控系统部署。
二 华为HECS主机开通
云耀云服务器(Hyper Elastic Cloud Server)是一种可以快速搭建且易于管理的新一代云服务器,提供从1核1G到8核32G的套餐并匹以相对的磁盘空间和公有云带宽, 助力中小企业便捷高效的在云端构建电商网站、Web应用、小程序、APP和各类开发测试、学习环境,相比普通云服务器更加简单易用(3步即可完成购买),提供极简上云体验。
- 便捷易用效率高
易开通,易搭建,易管理,一站式提升用户使用效率和体验:由华为瑶光智慧云脑提供技术支持,更优算力,稳定用云,更懂用户。
- 弹性灵活配置优
根据业务诉求,灵活变化规格,无需手动输入参数;快速匹配业务与投入,带来更好地投资收益和极致体验。
在北京一区开通一台2C4G的按量云服务器,进行监控系统部署。

系统为CenOS7.8

选择VPC与交换机,并选择安全组,勾选公网IP

配置云服务器名称与用户名密码。

确认配置进行购买。


利用mac终端ssh连接云服务器进行测试。

至此华为云服务器已开通完成,接下来进行监控系统配部署。
三 组件
在进行监控系统部署前先了解下各组件。
3.1 Telegraf
Telegraf是一个基于服务器的代理,从数据库、系统和物联网传感器收集和发送度量和事件。Telegraf用Go编写,编译成一个没有外部依赖的二进制文件–需要非常少的内存,相当于监控指标采集Agent。
3.2 Influxdb
InfluxDB是一个由InfluxData开发的开源时序型数据库,专注于海量时序数据的高性能读、高性能写、高效存储与实时分析等,在DB-Engines Ranking时序型数据库排行榜上排名第一,广泛应用于DevOps监控、IoT监控、实时分析等场景。
强大完整的生态,TICK是一个集成了采集、存储、分析、可视化等能力的开源时序中台,由Telegraf、 InfluxDB、Chronograf、Kapacitor 4个组件以一种灵活松散组合、但紧密配合互为补充的方式构成,各个模块项目配合、互为补充,专注于DevOps监控、IoT监控、实时分析等场景。
3.3 Grafana
Grafana是一款用Go语言开发的开源数据可视化工具,可以做数据监控和数据统计,带有告警功能。目前使用grafana的公司有很多,如paypal、ebay、intel等。
四 监控系统部署
利用xshell连接云服务器公网IP。
4.1 InfluxDB部署
cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo[influxdb]name = InfluxDB Repository - RHEL \$releaseverbaseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stableenabled = 1gpgcheck = 1gpgkey = https://repos.influxdata.com/influxdb.keyEOFsudo yum install influxdbsudo systemctl start influxdb4.2 Grafana部署
wget https://dl.grafana.com/enterprise/release/grafana-enterprise-8.5.4-1.x86_64.rpmsudo yum install grafana-enterprise-8.5.4-1.x86_64.rpmsystemctl start grafana-server4.3 Telegraf部署
cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo[influxdb]name = InfluxData Repository - Stablebaseurl = https://repos.influxdata.com/stable/\$basearch/mainenabled = 1gpgcheck = 1gpgkey = https://repos.influxdata.com/influxdb.keyEOFsudo yum install telegraftelegraf config > telegraf.conf五 监控系统配置
5.1 创建库
登录influxdb创建telegraf库

创建用户。

/etc/influxdb/influxdb.conf 启用认证
[http] # Determines whether HTTP endpoint is enabled. enabled = true # The bind address used by the HTTP service. bind-address = ":8086" # Determines whether user authentication is enabled over HTTP/HTTPS. auth-enabled = true5.2 配置telegraf将数据存储在influxdb中
编辑/etc/telegraf/telegraf.conf

- 启用认证
## HTTP Basic Auth username = "telegraf" password = "password"5.3 配置Grafana
启动grafana后修改密码,添加influxdb数据源,添加dashboard。

使用5955进行dashboard导入。


其他
- 再次influxdb未配置用户名密码,生产环境应配置。
- 应该针对telegraf进行配置过滤指标已适应业务。
- 需要在云服务器安全组开发grafana 3000端口,进行外部测试。
【华为云至简致远】有奖征文火热进行中:https://bbs.huaweicloud.com/blogs/352809
边栏推荐
- How about NFT market? Why is NFT so popular? How to build NFT platform
- 求你了,不要再在对外接口中使用枚举类型了!
- 关于#php#的问题:php写的原来的部署环境是在phpstudy里面进行部署的,php+MySQL+Apache但是由于每次都得保证电脑开着
- Gb28181 protocol has become the mainstream in the market. How to choose the appropriate security monitoring video solution?
- [bug resolution] the form is paged to display the total data res.data total
- UI inspiration analysis Notes 6: feature
- 看不懂Kotlin源码?从Contracts 函数说起~
- Shader shader
- Quic resistance
- [clearos] install the clearos system
猜你喜欢

Musk says he doesn't like being a CEO, but rather wants to do technology and design; Wu Enda's "machine learning" course is about to close its registration | geek headlines
](/img/43/c828e1cd8273c4d32397ff3e2d23cc.png)
工作总结之因为笛卡尔积问题写SQL搞了半天[害](附笛卡尔积总结)

历史上的今天:Apple II 问世;微软收购 GECAD;发明“软件工程”一词的科技先驱出生...

Teatalk · online speech record | complete! It is important to select the right data migration strategy for safe cloud deployment

如何写出高性能代码(四)优化数据访问

. 5 string

pip2pi和pypiserver及Apache在pip本地源配置中的应用实践

常用字体介绍

逆向学习入门-优秀的汇编调试工具OllyDbg

31w赛题奖金!当 AI for Science 撞上“先导杯”,会擦出什么样的火花?
随机推荐
.net core 抛异常对性能影响的求证之路
App manual signature of openharmony standard system
Live share experience
How to write high-performance code (IV) optimize data access
Audio adaptation of openharmony Standard System Porting
/usr/bin/gzip: 1: ELF: not found /usr/bin/gzip: 3: : not found /usr/bin/gzip: 4: Syntax erro
深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
[filter] design of time-varying Wiener filter based on MATLAB [including Matlab source code 1870]
kubernetes 证书合集
Luo Jing: connection Efficiency Optimization Practice
【后台交互】select 绑定后台传递的数据
Schéma de dessin utilisé par les Pads
#61. Two point answer
漫谈软件缺陷与漏洞
QQ pulls up Alipay H5 payment function
分页浏览后搜索无数据
面试造航母,入职拧螺丝,工资...
Network information system emergency response
关于#php#的问题:php写的原来的部署环境是在phpstudy里面进行部署的,php+MySQL+Apache但是由于每次都得保证电脑开着
QUIC的阻力