当前位置: 首页 > news >正文

Pinpoint(APM)进阶--Pinot指标采集(System Metric/Inspector)

接上文
Pinpoint使用Pinot进行指标数据存储,Pinot流摄入需要Kafka
本文详解Kafka和Pinot的安装部署,以及Pinpoint的指标采集
在这里插入图片描述

Pinot

简介

Apache Pinot是一个实时分布式OLAP数据存储,专为低延迟、高吞吐量分析而构建,非常适合面向用户的分析工作负载。
Apache Pinot™是一个实时分布式在线分析处理(OLAP)数据存储。使用Pinot从流式或批处理数据源(包括Apache Kafka、Amazon Kinesis、Hadoop HDFS、Amazon S3、Azure ADLS和Google Cloud Storage)摄取并立即查询数据。

支持面向产品最终用户的分析工具,在面向用户的分析应用程序中,所有用户都会在他们的设备上收到个性化分析,导致每秒数十万次查询。应用程序触发的查询可能会与应用程序上的活跃用户数量成比例快速增长,每秒多达数百万个事件。Pinot中生成的数据可以在一秒钟内立即用于分析。

安装

下载

PINOT_VERSION=1.1.0 #set to the Pinot version you decide to usewget https://downloads.apache.org/pinot/apache-pinot-$PINOT_VERSION/apache-pinot-$PINOT_VERSION-bin.tar.gz

解压tar包

启动controller

nohup ./pinot-admin.sh StartController \-zkAddress localhost:2181 \-controllerPort 9000 &

在这里插入图片描述
启动broker

nohup ./pinot-admin.sh StartBroker \-zkAddress localhost:2181 &

在这里插入图片描述
启动server

nohup ./pinot-admin.sh StartServer \-zkAddress localhost:2181 &

在这里插入图片描述
启动kafka

nohup ./pinot-admin.sh  StartKafka \-zkAddress=localhost:2181/kafka \-port 19092 &

创建topic

./kafka-topics.sh --create --topic inspector-stat-agent-00 --bootstrap-server localhost:9092
./kafka-topics.sh --create --topic inspector-stat-app --bootstrap-server localhost:9092
./kafka-topics.sh --create --topic system-metric-data-type --bootstrap-server localhost:9092
./kafka-topics.sh --create --topic system-metric-tag --bootstrap-server localhost:9092
./kafka-topics.sh --create --topic system-metric-double --bootstrap-server localhost:9092

在这里插入图片描述
在这里插入图片描述

下载脚本(采集数据的表)
https://github.com/pinpoint-apm/pinpoint/tree/master/inspector-module/inspector-collector/src/main/pinot
https://github.com/pinpoint-apm/pinpoint/tree/master/metric-module/metric/src/main/pinot

将table后缀的脚本里的replicasPerPartition和replication改为1(单点模式)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

执行脚本

./multi-table.sh 0 0 http://localhost:9000

两个参数表示新增从inspectorStatAgentXX到inspectorStatAgentXX的表, 0 0 表示inspectorStatAgent00,0 2表示inspectorStatAgent00 - inspectorStatAgent02
在这里插入图片描述

./pinot-admin.sh AddTable \-schemaFile ../pinot-dataType-schema.json \-tableConfigFile ../pinot-dataType-realtime-table.json \-exec./pinot-admin.sh AddTable \-schemaFile ../pinot-tag-schema.json \-tableConfigFile ../pinot-tag-realtime-table.json \-exec./pinot-admin.sh AddTable \-schemaFile ../pinot-double-schema.json \-tableConfigFile ../pinot-double-realtime-table.json \-exec./pinot-admin.sh AddTable \-schemaFile ../pinot-inspector-stat-agent-schema.json \-tableConfigFile ../pinot-inspector-stat-agent-realtime-table.json \-exec./pinot-admin.sh AddTable \-schemaFile ../pinot-inspector-stat-application-schema.json \-tableConfigFile ../pinot-inspector-stat-application-realtime-table.json \-exec

成功启动后访问http://ip:9000
在这里插入图片描述

Telegraf

基于服务器的代理,从数据库、系统和物联网传感器收集和发送指标和事件。Telegraf是用Go编写的,可以编译成一个没有外部依赖的二进制文件,只需要很少的内存。

安装

官方网站下载包
https://docs.influxdata.com/telegraf
在这里插入图片描述

wget https://dl.influxdata.com/telegraf/releases/telegraf-1.32.2_linux_amd64.tar.gz

创建配置文件

./telegraf --sample-config > telegraf.conf

添加如下配置

[[outputs.http]]url = "http://127.0.0.1:15200/telegraf"data_format = "json"[outputs.http.headers]hostGroupName = "leon-test"Content-Type = "application/json"

inputs.system增加一个配置
在这里插入图片描述

移动配置文件

mv telegraf.conf /etc/telegraf/telegraf.conf

启动telegraf

nohup /root/telegraf-1.32.2/usr/bin/telegraf &

Collector

下载或编译collector-starter包
创建一个配置文件application.yml,配置pinot的数据源

spring:main:allow-bean-definition-overriding: false
#    web-application-type: noneprofiles:active: localshell:history:enabled: falsepinot-datasource:pinot:jdbc-url: jdbc:pinot://localhost:9000pinpoint:modules:collector:exceptiontrace:enabled: trueinspector:enabled: truehbase:enabled: truetype: ALLrealtime:enabled: falsemetric:kafka:bootstrap:servers: localhost:19092zookeeper:address: 127.0.0.1

带上配置文件启动collector-starter

nohup java --add-opens java.base/java.nio=ALL-UNNAMED -jar -Dspring.config.additional-location=./application.yml pinpoint-collector-starter-3.0.0-exec.jar &

Web

下载或编译web-starter包
创建一个配置文件application.yml,配置pinot的数据源

spring:main:allow-bean-definition-overriding: truejackson:mapper:default-view-inclusion: trueprofiles:active: release, metricpinot-datasource:pinot:jdbc-url: jdbc:pinot://localhost:9000server:port: 8080error:path: /api/errorinclude-exception: trueinclude-message: alwaysinclude-binding-errors: alwaysinclude-stacktrace: alwayswhitelabel:enabled: truepinpoint:modules:web:exceptiontrace:enabled: trueinspector:enabled: truerealtime:enabled: falsezookeeper:address: 127.0.0.1

带上配置文件启动web-starter

nohup java --add-opens java.base/java.nio=ALL-UNNAMED -jar -Dspring.config.additional-location=./application.yml pinpoint-web-starter-3.0.0-exec.jar &

功能验证

Inspector采集

在这里插入图片描述

Metric采集

在这里插入图片描述

http://www.lryc.cn/news/483549.html

相关文章:

  • Mysql:使用binlog的一些常用技巧
  • Electron 项目启动外部可执行文件的几种方式
  • 前端开发中常用的包管理器(npm、yarn、pnpm、bower、parcel)
  • Linux入门:环境变量与进程地址空间
  • 【Jenkins实战】Windows安装服务启动失败
  • web实操5——http数据详解,request对象功能
  • C# 如何动态加载程序集
  • 前端基础的讲解-JS(10)
  • JNI整理总结
  • aws中AcmClient.describeCertificate返回值中没有ResourceRecord
  • Spring Task详细讲解
  • C++初阶 --- 类和对象(1)
  • 《TCP/IP网络编程》学习笔记 | Chapter 7:优雅地断开套接字连接
  • Anaconda 和 conda 是什么关系?就像 pip 和 python 一样吗
  • 「数据治理」核心专业术语解释!
  • Mac Nginx 前端打包部署
  • 乳腺癌诊断分析——基于聚类分析实现
  • Ubuntu 22.04 安装配置opencv
  • 【软考】系统架构设计师-计算机系统基础(3):嵌入式系统
  • 实测运行容器化Tomcat服务器
  • 致敬苹果的国产手机,只会失去更多市场,iPhone一骑绝尘!
  • 《MYSQL45讲》kill不掉的线程
  • 单体架构 IM 系统之 Server 节点状态化分析
  • java xml 文本解析
  • Docker占用空间太大磁盘空间不足清理妙招
  • 编程之路,从0开始:字符函数和字符串函数
  • 化工防爆巡检机器人:在挑战中成长,为化工安全保驾护航
  • 音频采样数据格式
  • 【pytorch】常用强化学习算法实现(持续更新)
  • DAY59||并查集理论基础 |寻找存在的路径