1 官网内容

  上面的配置是r1获取到的内容会同时复制到c1 c2 c3 三个channel里面

2 详细配置信息

  

# Name the components on this agent
a1.sources = r1
a1.sinks = k1 k2
a1.channels = c1 c2 # Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /tmp/logs/cmcc.log # Describe the sink
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.topic = cmcc1
a1.sinks.k1.brokerList = hdp1:9092,hdp2:9092,hdp3:9092
a1.sinks.k1.requiredAcks = 1
a1.sinks.k1.batchSize = 20 a1.sinks.k2.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k2.topic = cmcc2
a1.sinks.k2.brokerList = hdp1:9092,hdp2:9092,hdp3:9092
a1.sinks.k2.requiredAcks = 1
a1.sinks.k1.batchSize = 20 a1.sinks.k2.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k2.topic = cmcc2
a1.sinks.k2.brokerList = hdp1:9092,hdp2:9092,hdp3:9092
a1.sinks.k2.requiredAcks = 1
a1.sinks.k2.batchSize = 20 # Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100 a1.channels.c2.type = file
a1.channels.c2.checkpointDir = /tmp/flume/checkpoint
a1.channels.c2.dataDirs = /tmp/flume/data # Bind the source and sink to the channel
a1.sources.r1.channels = c1 c2 # set channel for sinks
a1.sinks.k1.channel = c1
a1.sinks.k2.channel = c2
# #
a1.sources.r1.selector.type = replicating
#

3 查看消费情况

  

topic cmcc1的消费情况

	 	kafka-console-consumer.sh  --zookeeper hdp1:2181,hdp2:2181,hdp3:2181/kafka1.1.0  --topic cmcc1 --from-beginning
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
zhangjin
xxxx
yyyy topic cmcc2的消费情况 /tmp/logs]#kafka-console-consumer.sh --zookeeper hdp1:2181,hdp2:2181,hdp3:2181/kafka1.1.0 --topic cmcc2 --from-beginning
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
zhangjin
xxxx
yyyy

  

4 查看tail的文件内容

	hello
world
java
scala
hadoop
zhangjin
xxxx
yyyy
zhangjin
xxxx
yyyy

  

  

4 总结
应该是启动了两次的原因,实际上是把文件重复两次的发送到了每个sink里面,实现了实验要求

Flume配置Replicating Channel Selector的更多相关文章

  1. Flume配置Multiplexing Channel Selector

    1 官网内容 上面配置的是根据不同的heder当中state值走不同的channels,如果是CZ就走c1 如果是US就走c2 c3 其他默认走c4 2 我的详细配置信息 一个监听http端口 然后 ...

  2. Flume-Replicating Channel Selector 单数据源多出口

    使用 Flume-1 监控文件变动,Flume-1 使用 Replicating Channel Selector 将变动内容传递给 Flume-2,Flume-2 负责存储到 HDFS.同时 Flu ...

  3. Flume Channel Selector

    Flume 基于Channel Selector可以实现扇入.扇出. 同一个数据源分发到不同的目的,如下图. 在source上可以定义channel selector: 1 2 3 4 5 6 7 8 ...

  4. Hadoop生态圈-Flume的主流Channel源配置

    Hadoop生态圈-Flume的主流Channel源配置 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.   一. 二. 三.

  5. org.apache.flume.conf.ConfigurationException: Channel c1 not in active set.

    1 错误详细信息 WARN conf.FlumeConfiguration: Could not configure sink k1 due to: Channel c1 not in active ...

  6. flume配置和说明(转)

    Flume是什么 收集.聚合事件流数据的分布式框架 通常用于log数据 采用ad-hoc方案,明显优点如下: 可靠的.可伸缩.可管理.可定制.高性能 声明式配置,可以动态更新配置 提供上下文路由功能 ...

  7. 关于flume配置加载(二)

    为什么翻flume的代码,一方面是确实遇到了问题,另一方面是想翻一下flume的源码,看看有什么收获,现在收获还谈不上,因为要继续总结.不够已经够解决问题了,而且确实有好的代码,后续会继续慢慢分享,这 ...

  8. [从源码学设计] Flume 之 memory channel

    [从源码学设计] Flume 之 memory channel 目录 [从源码学设计] Flume 之 memory channel 0x00 摘要 0x01 业务范畴 1.1 用途和特点 1.2 C ...

  9. 实时事件统计项目:优化flume:用file channel代替mem channel

    背景:利用kafka+flume+morphline+solr做实时统计. solr从12月23号开始一直没有数据.查看日志发现,因为有一个同事加了一条格式错误的埋点数据,导致大量error. 据推断 ...

随机推荐

  1. JavaScript深入之词法作用域和动态作用域

    作用域 作用域是指程序源代码中定义变量的区域. 作用域规定了如何查找变量,也就是确定当前执行代码对变量的访问权限. JavaScript 采用词法作用域,也就是静态作用域. 静态作用域与动态作用域 因 ...

  2. 构建flutter环境并实现属于我们的hello world

    我们知道flutter和react-native一样,都是既可以运行在andorid也可以运行在iOS环境下的. 我之前是react-native开发者,我的电脑环境中已经安装好了jdk,sdk,以及 ...

  3. webpack 非严格模式设置 npm i babel-plugin-transform-remove-strict-mode

    安装插件:npm i babel-plugin-transform-remove-strict-mode 在.babelrc文件的插件项添加:"transform-remove-strict ...

  4. anaconda的安装教程和使用方法

    一.anaconda安装方法: 1.下载: anaconda官方下载地址:https://www.anaconda.com/download/ 2.安装: 可以自己指定路劲,也可以选择默认安装,最后记 ...

  5. fcntl F_SETFL

    F_SETFL file set flag F_SETFL命令允许更改的标志有O_APPEND,O_NONBLOCK,O_NOATIME,O_DIRECT,O_ASYNC 这个操作修改文件状态标记适用 ...

  6. 2018.12.21 浪在ACM 集训队第十次测试赛

     浪在ACM 集训队第十次测试赛 A Diverse Substring B Vasya and Books C Birthday D LCM A 传送门 题解 B 传送门 题解: 这道题,就比较简单 ...

  7. Tomcat 一般异常处理方式

    1.启动时出现: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/ ...

  8. Mysq基础l数据库管理、表管理、增删改数据整理

    一.       数据库管理: 创建数据库: create database(自定义) 查询所有数据库: show databases;(查询所有数据库) show create database ( ...

  9. django-rest-framework-jwt

    官网文档:http://getblimp.github.io/django-rest-framework-jwt/ GitHub:https://github.com/GetBlimp/django- ...

  10. 2017-12-18python全栈9期第三天第四节之str的索引与切片

    #!/user/bin/python# -*- coding:utf-8 -*-s = 'zdlswwzl's1 = s[0]print(s1)s2 = s[-1]print(s2)s3 = s[0: ...