如何监控Apache Flume代理状态?



我知道企业(例如Cloudera(的方式,通过使用CM(通过浏览器(或Cloudera REST API,可以访问监控和配置设施。

但是,如何在没有CM的情况下安排(运行和重新运行(水槽代理实时循环,并监控其运行/故障状态?水槽分布中有这样的东西吗?

Flume的JSON Reporting API可用于监控运行状况和性能。 链接

我尝试在开始时将flume.monitoring.type/port添加到flume-ng。它完全符合我的需求。

例如,让我们创建一个简单的代理a1。侦听localhost:44444并作为接收器记录到控制台:

# flume.conf
a1.sources = s1
a1.channels = c1
a1.sinks = d1
a1.sources.s1.channels = c1
a1.sources.s1.type = netcat
a1.sources.s1.bind = localhost
a1.sources.s1.port = 44444
a1.sinks.d1.channel = c1
a1.sinks.d1.type = logger
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100
a1.channels.c1.transactionCapacity = 10

使用其他参数运行它flume.monitoring.type/port

flume-ng agent -n a1 -c conf -f flume.conf -Dflume.root.logger=INFO,console -Dflume.monitoring.type=http -Dflume.monitoring.port=44123

然后在浏览器中监视输出localhost:44123/metrics

{"CHANNEL.c1":{"ChannelCapacity":"100","ChannelFillPercentage":"0.0","Type":"CHANNEL","EventTakeSuccessCount":"570448","ChannelSize":"0","EventTakeAttemptCount":"570573","StartTime":"1567002601836","EventPutAttemptCount":"570449","EventPutSuccessCount":"570448","StopTime":"0"}}

只需尝试一些负载:

dd if=/dev/urandom count=1024 bs=1024 | base64 | nc localhost 44444

最新更新