Flume监控指标项
配置监控
1、修改flume-env.sh
export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port= -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
2、使用以下启动命令
flume-ng agent \
-n a1 \
-c $FLUME_HOME/conf \
-f $FLUME_HOME/conf/exec-memory-hdfs-partition.conf \
-Dflume.root.logger=INFO,console \
-Dflume.monitoring.type=http \
-Dflume.monitoring.port=1234
指标项整理
OS监控项
| objectName | 指标项 | 说明 |
|---|---|---|
| java.lang:type=OperatingSystem | FreePhysicalMemorySize | 空闲物理内存 |
| java.lang:type=OperatingSystem | SystemCpuLoad | 系统CPU利用率 |
| java.lang:type=OperatingSystem | ProcessCpuLoad | 进程CPU利用率 |
| java.lang:type=GarbageCollector,name=PS Scavenge | CollectionCount | GC次数 |
json数据格式
# curl http://localhost:/metrics
{
"SOURCE.src-1":{
"OpenConnectionCount":"0",
"Type":"SOURCE",
"AppendBatchAcceptedCount":"1355",
"AppendBatchReceivedCount":"1355",
"EventAcceptedCount":"28286",
"AppendReceivedCount":"0",
"StopTime":"0",
"StartTime":"1442566410435",
"EventReceivedCount":"28286",
"AppendAcceptedCount":"0"
},
"CHANNEL.ch-1":{
"EventPutSuccessCount":"28286",
"ChannelFillPercentage":"0.0",
"Type":"CHANNEL",
"StopTime":"0",
"EventPutAttemptCount":"28286",
"ChannelSize":"0",
"StartTime":"1442566410326",
"EventTakeSuccessCount":"28286",
"ChannelCapacity":"1000000",
"EventTakeAttemptCount":"313734329512"
},
"SINK.sink-1":{
"Type":"SINK",
"ConnectionClosedCount":"0",
"EventDrainSuccessCount":"28286",
"KafkaEventSendTimer":"482493",
"BatchCompleteCount":"0",
"ConnectionFailedCount":"0",
"EventDrainAttemptCount":"0",
"ConnectionCreatedCount":"0",
"BatchEmptyCount":"0",
"StopTime":"0",
"RollbackCount":"9",
"StartTime":"1442566411897",
"BatchUnderflowCount":"0"
}
}
指标项说明
source监控项
| objectName (会随实际情况而变化) |
指标项 | 说明 |
|---|---|---|
| org.apache.flume.source:type=r1 | OpenConnectionCount | 目前与客户端或sink保持连接的总数量 |
| org.apache.flume.source:type=r1 | AppendBatchAcceptedCount | 成功提交到channel的批次的总数量 |
| org.apache.flume.source:type=r1 | AppendBatchReceivedCount | 接收到事件批次的总数量 |
| org.apache.flume.source:type=r1 | AppendAcceptedCount | 逐条录入的次数 |
| org.apache.flume.source:type=r1 | AppendReceivedCount | 每批只有一个事件的事件总数量 |
| org.apache.flume.source:type=r1 | EventAcceptedCount | 成功写出到channel的事件总数量 |
| org.apache.flume.source:type=r1 | EventReceivedCount | 目前为止source已经接收到的事件总数量 |
| org.apache.flume.source:type=r1 | StartTime | source启动时的毫秒值时间 |
| org.apache.flume.source:type=r1 | StopTime | source停止时的毫秒值时间,为0表示一直在运行 |
channel监控项
| objectName (会随实际情况而变化) |
指标项 | 说明 |
|---|---|---|
| org.apache.flume.channel:type=c1 | EventPutAttemptCount | Source尝试写入Channe的事件总次数 |
| org.apache.flume.channel:type=c1 | EventPutSuccessCount | 成功写入channel且提交的事件总次数 |
| org.apache.flume.channel:type=c1 | EventTakeAttemptCount | sink尝试从channel拉取事件的总次数。 |
| org.apache.flume.channel:type=c1 | EventTakeSuccessCount | sink成功从channel读取事件的总数量 |
| org.apache.flume.channel:type=c1 | ChannelSize | 目前channel中事件的总数量 |
| org.apache.flume.channel:type=c1 | ChannelCapacity | channel的容量 |
| org.apache.flume.channel:type=c1 | ChannelFillPercentage | channel已填入的百分比 |
| org.apache.flume.channel:type=c1 | StartTime | channel启动时的毫秒值时间 |
| org.apache.flume.channel:type=c1 | StopTime | channel停止时的毫秒值时间,为0表示一直在运行 |
sink监控项
| objectName (会随实际情况而变化) |
指标项 | 说明 |
|---|---|---|
| org.apache.flume.sink:type=k1 | ConnectionCreatedCount | 创建的连接数量 |
| org.apache.flume.sink:type=k1 | ConnectionClosedCount | 关闭的连接数量 |
| org.apache.flume.sink:type=k1 | ConnectionFailedCount | 由于错误关闭的连接数量 |
| org.apache.flume.sink:type=k1 | BatchEmptyCount | 批量处理event的个数为0的数量-表示source写入数据的速度比sink处理数据的速度慢 |
| org.apache.flume.sink:type=k1 | BatchUnderflowCount | 批量处理event的个数小于批处理大小的数量 |
| org.apache.flume.sink:type=k1 | BatchCompleteCount | 批量处理event的个数等于批处理大小的数量 |
| org.apache.flume.sink:type=k1 | EventDrainAttemptCount | sink尝试写出到存储的事件总数量 |
| org.apache.flume.sink:type=k1 | EventDrainSuccessCount | sink成功写出到存储的事件总数量 |
| org.apache.flume.sink:type=k1 | StartTime | channel启动时的毫秒值时间 |
| org.apache.flume.sink:type=k1 | StopTime | channel停止时的毫秒值时间,为0表示一直在运行 |
Flume启动关闭脚本:
# vim flume.sh
#!/bin/bash
path=/usr/local/apache-flume-1.9.-bin
JAR="flume"
Flumeconf="flume.conf"
agentname="agent1" function start(){
num=`ps -ef|grep java|grep $JAR|wc -l`
if [ "$num" = "" ] ;then
nohup $path/bin/flume-ng agent \
-c $path/conf -f $path/conf/$Flumeconf -n $agentname \
-Dflume.root.logger=INFO,LOGFILE -Dflume.log.dir=$path/logs \
-Dflume.monitoring.type=http -Dflume.monitoring.port= >/dev/null >& &
echo "start successful ......"
echo "日志路径: $path/logs/flume.log"
else
echo "进程已经存在,启动失败,请检查 ......"
exit
fi
} function stop(){
num=`ps -ef|grep java|grep $JAR|wc -l`
if [ "$num" != "" ];then
ps -ef|grep java|grep $JAR|awk '{print $2}'|xargs kill -9
echo "stop successful ......"
else
echo "服务未启动,无需停止 ......"
fi
} function restart(){
stop
num=`ps -ef|grep java|grep $JAR|wc -l`
while [ $num -gt ];do
sleep
num=`ps -ef|grep java|grep $JAR|wc -l`
done
start
echo "restarted successful ......"
} case "$1" in
"start") start ;;
"stop") stop ;;
"restart") restart ;;
*) ;;
esac
# sh flume.sh start
Flume监控指标项的更多相关文章
- kafka监控指标项
监控配置 kafka基本分为broker.producer.consumer三个子项,每一项的启动都需要用到 $KAFKA_HOME/bin/kafka-run-class.sh 脚本,在该脚本中 ...
- hbase 监控指标项
名词解释 JMX:Java Management Extensions,用于用于Java程序扩展监控和管理项 GC:Garbage Collection,垃圾收集,垃圾回收机制 指标项来源 主机名 u ...
- Hbase监控指标项
名词解释 JMX:Java Management Extensions,用于用于Java程序扩展监控和管理项 GC:Garbage Collection,垃圾收集,垃圾回收机制 指标项来源 主机名 u ...
- Hadoop监控指标项
配置 修改$HADOOP_HOME/etc/hadoop/hadoop-env.sh # 在配置namenode和datanode时都会有用到JMX_OPTS的代码,是为了减少重复提取出的公共代码 e ...
- Spark指标项监控
监控配置 spark的监控主要分为Master.Worker.driver.executor监控.Master和Worker的监控在spark集群运行时即可监控,Driver和Excutor的监控需要 ...
- Linux CPU监控指标
Linux CPU监控指标 Linux提供了非常丰富的命令可以进行CPU相关数据进行监控,例如:top.vmstat等命令.top是一个动态显示过程,即可以通过用户按键来不断刷新当前状态.如果在前台执 ...
- 【转载一】Grafana –美观、强大的可视化监控指标展示工具
在之前的InfluxDB系列教程 中,我们给大家介绍了当下流行的一款时序数据库--InfluxDB. 接下来给大家带来一款强大的,与InfluxDB搭配使用的前端指标项展示项目--Grafana. G ...
- 大数据技术之_09_Flume学习_Flume概述+Flume快速入门+Flume企业开发案例+Flume监控之Ganglia+Flume高级之自定义MySQLSource+Flume企业真实面试题(重点)
第1章 Flume概述1.1 Flume定义1.2 Flume组成架构1.2.1 Agent1.2.2 Source1.2.3 Channel1.2.4 Sink1.2.5 Event1.3 Flum ...
- MySQL 监控指标
为了排查问题,对数据库的监控是必不可少的,在此介绍下 MySQL 中的常用监控指标. 简介 MySQL 有多个分支版本,常见的有 MySQL.Percona.MariaDB,各个版本所对应的监控项也会 ...
随机推荐
- jmeter使用小结
写这篇短文主要想详细介绍一下jmeter中取样器.逻辑控制器.前置处理器.后置处理器.定时器.配置元件等,可能看起来比较繁杂,其实里面很多操作是类似的,一篇总结和记录的博客: jmeter官方用户手册 ...
- 阿里巴巴Java开发手册(华山版).pdf
https://github.com/alibaba/p3c/blob/master/阿里巴巴Java开发手册(华山版).pdf
- python基础知识笔记-集合
集合使用花括号将元素之间用逗号隔开即可.集合的输出里不会出现相同的元素.集合中有并集.交集.差集等,以下为一些简单的表达: def main(): list1=[1,1,2,2,3,3] print( ...
- python应用-综合应用题解决
题目: A,B,C,D,E五个人捕鱼,不计其数,然后休息, 早上A第一个醒来,将鱼均分成五份,把多余的一条鱼扔掉,拿走自己的一份, B第二个醒来,也将鱼均分为五份,把多余的一条鱼扔掉,拿走自己的一份. ...
- 牛客NOIP暑期七天营-普及组2D
链接:https://ac.nowcoder.com/acm/contest/926/D来源:牛客网 在一维坐标系中,给定 n条有颜色的线段,第 i条线段的左右端点分别为 li和 ri,此外它的颜 ...
- PHP memcache 环形队列
<?php /** * PHP memcache 环形队列类 * 因业务需要只保留的队列中的Pop和Push,修改过期时间为0即永久 */ class MQueue { pub ...
- Ruby Raise rescue
ruby1.9以上,retry只能支持在rescue里面使用,不支持在block里面用:你要去用ruby1.8 rescue使用代码例子 # -*- coding: UTF-8 -*- n = 0 b ...
- post Cache
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5 POST The POST method is used to request ...
- Trolley slow
- 线程太多导致socket连接池爆满,进程启动不了
Issue: 某部机上跟其它机器的连接有问题,ping可以通,telnet端口不通,可以其它机器可以连接到该机器上的进程. java应用启动不起来,产生以下错误. java.net.SocketExc ...