05_ Flume多级Agent之间串联案例
多级agent之间串联:
从tail命令获取数据发送到avro端口,另一个节点可配置一个avro源来获取数据,发送外部存储
启动两个Agent节点:
使用scp命令拷贝flume安装包到另一台虚拟机;scp -r /usr/local/src/flume/ shizhan3:$PWD
1.在shizhan2虚拟上配置采集方案:tail-avro-avro-logger.con
##################
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1 # Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /home/hadoop/log/test.log
a1.sources.r1.channels = c1 # Describe the sink
#绑定的不是本机, 是另外一台机器的服务地址, sink端的avro是一个发送端, avro的客户端, 往shizhan3这个机器上发
a1.sinks = k1
a1.sinks.k1.type = avro
a1.sinks.k1.channel = c1
a1.sinks.k1.hostname = shizhan3
a1.sinks.k1.port = 4141
a1.sinks.k1.batch-size = 2 # Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
2.在shizhan3虚拟上配置采集方案:avro-hdfs.conf(从avro端口接收数据,下沉到logger)
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1 # Describe/configure the source
#source中的avro组件是接收者服务, 绑定本机
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4141 # Describe the sink
a1.sinks.k1.type = logger # Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
启动shizhan3的Agent采集方案采集数据:将日志信息打印输出到屏幕
bin/flume-ng agent -c conf -f conf/avro-hdfs.conf -n al -Dflume.root.logger=INFO,console
往日志文件中不断输入内容,并启动启动shizhan2的Agent采集方案采集数据
05_ Flume多级Agent之间串联案例的更多相关文章
- Flume原理分析与使用案例
1.flume的特点: flume是一个分布式.可靠.和高可用的海量日志采集.聚合和传输的系统.支持在日志系统中定制各类数据发送方,用于收集数据:同时,Flume提供对数据进行简单处理,并写到各种数据 ...
- Java基础知识强化之IO流笔记50:IO流练习之 复制多级文件夹的案例
1. 复制多级文件夹的案例 需求:复制多级文件夹 数据源:E:\JavaSE\day21\code\demos 目的地:E:\ 分析: A:封装数据源File ...
- Flume的Agent
Flume的Agent text(“filename”):将文件filename作为数据源,按行发送 tail(“filename”):探测filename新产生的数据,按行发送出去 fsyslogT ...
- 大数据学习——实现多agent的串联,收集数据到HDFS中
采集需求:比如业务系统使用log4j生成的日志,日志内容不断增加,需要把追加到日志文件中的数据实时采集到hdfs,使用agent串联 根据需求,首先定义以下3大要素 第一台flume agent l ...
- 04_ Flume采集文件到HDFS案例
采集需求:比如业务系统使用log4j生成的日志,日志内容不断增加,需要把追加到日志文件中的数据实时采集到hdfs 根据需求,首先定义以下3大要素 采集源,即source——监控文件内容更新 : ex ...
- Flume的四个使用案例
一.Flume监听端口 1,在linux机器上下载telnet工具 yum search telnet yumm install telnet.x86_64 2.编写flume的配置文件,并将文件复制 ...
- SqoopFlume、Flume、HDFS之间比较
Sqoop Flume HDFS Sqoop用于从结构化数据源,例如,RDBMS导入数据 Flume 用于移动批量流数据到HDFS HDFS使用 Hadoop 生态系统存储数据的分布式文件系统 Sqo ...
- BEvent_客制化Event Agent通道(案例)(待整理)
2014-09-09 Created By BaoXinjian
- python关于多级包之间的引用问题
首先得明确包和模块. 包:在一个目录下存在__init__.py,那么该目录就是一个包. 模块:一个.py文件就是一个模块. 我们可以通过from 包 import 模块来引入python文件, 也可 ...
随机推荐
- 【ARTS】01_29_左耳听风-201900527~201900602
ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...
- Vue 组件基础完整示例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- CG标准函数
- Leetcode 69. Sqrt(x)及其扩展(有/无精度、二分法、牛顿法)详解
Leetcode 69. Sqrt(x) Easy https://leetcode.com/problems/sqrtx/ Implement int sqrt(int x). Compute an ...
- 不同Json工具对空串和NULL的序列号处理:net.sf.json 和 fastjson
目录 1.测试代码 2.测试结果: 3.总结: 4.注:Maven中引入net.sf.json的方式 net.sf.json 和 fastjson 对于空串和NULL的处理: 1.测试代码 packa ...
- 【log4j】的学习和理解 + 打印所有 SQL
log4j 1.2 学习和理解 + 打印所有 SQL 一.基本资料 官方文档:http://logging.apache.org/log4j/1.2/manual.html(理解基本概念和其他) lo ...
- 码云、coding拉取项目代码
1.git init 2.git remote add origin "你的码云或coding项目地址(ssh或https)" 3.git pull origin master
- css常见双栏和三栏布局
左侧固定右侧自适应 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- 洛谷P3381 最小费用最大流模板
https://www.luogu.org/problem/P3381 题目描述 如题,给出一个网络图,以及其源点和汇点,每条边已知其最大流量和单位流量费用,求出其网络最大流和在最大流情况下的最小费用 ...
- 澎湃新闻速览版UWP 隐私策略
ThePaper UWP 此为 澎湃新闻速览版 的隐私策略,本隐私策略内容会不定期更新,以最新内容为主. 若您已经阅读并了解以下内容后,并继续使用该软件,即表示您已同意该协议. 内容: 这是澎湃新闻的 ...