关于Flume-ng那些事(三)

网友投稿 677 2023-02-15

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

关于Flume-ng那些事(三)

agentA  (10.1.124.197)agentB(10.1.124.196)agent(10.1.124.198)

测试一

agentA  = > agentB 从客户端推送数据到 agentB ,更改channel 为jdbc 保证events 数据可靠性。

## weblog agent config   agent A 配置

#List sources, sinks and channels in the agent
weblog-agent.sources = avro-sour
weblog-agent.sinks = avro-forward-sink
weblog-agent.channels = jdbc-channel
#define the flow
#webblog-agent sources config
weblog-agent.sources.avro-sour.channels = jdbc-channel
weblog-agent.sources.avro-sour.type = avro
weblog-agent.sources.avro-sour.bind = 0.0.0.0
weblog-agent.sources.avro-sour.port = 41414
#avro sink properties
weblog-agent.sinks.avro-forward-sink.channel = jdbc-channel
weblog-agent.sinks.avro-forward-sink.type = avro
weblog-agent.sinks.avro-forward-sink.hostname = 10.1.124.196
weblog-agent.sinks.avro-forward-sink.port = 41414
#channels config
#weblog-agent.channels.jdbc-channel.type = memory
weblog-agent.channels.jdbc-channel.type = jdbc

agnetB 配置:

agent A  上执行:flume-ng agent -n agent1 -c /opt/apps/flume-ng/conf/ -f flume.conf  &

测试二

根据测试一继续测试events 可靠性,stop掉agentB上flume agent 服务。在agent A上测试写入数据。 start agentB上flume agent服务。agentA上的events 同步到agentB上。

测试三

agentA 使用exec 执行tail 作为 sources  ,使用agentB 和agentC作为收集数据点。

|---------------agentBagentA|---------------agentC

agnetA上执行:flume-ng agent -n weblog-agent -c /opt/apps/flume-ng/conf/ -f flume.conf &

agnetB,C上执行:flume-ng agent -n agent1 -c /opt/apps/flume-ng/conf/ -f flume.conf  &测试结果: agentA上event会分别写到agentB和agentC,类似于lvs rr模式,stop  agentC上的flume agent后agentA上的event会写到agentB上,恢复agentC后,agentA上的event重新轮询写到agentB和C上。

测试四agentB和agentC做agentA sink的HA方法,该配置使用Flume Sink Processors 。

可以观察下该agnetA配置文件同测试三的差别

定义一个sinkgroups 组。该组中成员只有一个进行sinks工作。priority 值越大,代表优先级越高。 priority值相同时,取最后出现的成员。

测试结果:avro-forward-sink02  提供sink工作。sotp掉agentC 上flume agent   ,agentA上的event 使用avro-forward-sink01    发送到agentB上恢复agentC上的flume agent ,相应event从新发送到agentC。

测试五

agentC----|| ====> agentB   agentA-----|

测试内容,汇聚,配置文件同agentA & agentC

## weblog agent config agentA & agentC

#List sources, sinks and channels in the agent
weblog-agent.sources = avro-sour
weblog-agent.sinks = avro-forward-sink
weblog-agent.channels = jdbc-channel
#define the flow
#webblog-agent sources config
weblog-agent.sources.avro-sour.channels = jdbc-channel
weblog-agent.sources.avro-sour.type = avro
weblog-agent.sources.avro-sour.bind = 0.0.0.0
weblog-agent.sources.avro-sour.port = 41414
#weblog-agent.sources.avro-sour.restart = true
#avro sink properties
weblog-agent.sinks.avro-forward-sink.channel = jdbc-channel
weblog-agent.sinks.avro-forward-sink.type = avro
weblog-agent.sinks.avro-forward-sink.hostname = 10.1.124.196
weblog-agent.sinks.avro-forward-sink.port = 41414
#channels config
#weblog-agent.channels.jdbc-channel.type = memory
weblog-agent.channels.jdbc-channel.type = jdbc

agentB

测试结果,汇聚正常。

测试六

测试内容,sources select type  replicating  ,我称为日志raid1。将agentA 的event 写到agentB和C

agentA 配置文件如下:

上一篇:运维工程师烦心事件(运维工程师烦心事件怎么办)
下一篇:sudo管理和mysql的安装—puppet系列
相关文章

 发表评论

暂时没有评论,来抢沙发吧~