【1 Flume组成架构】
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3be3dd24a2420d14eede288f937ec10b.png)
【1】Agent
- 组成:Source、Channel、Sink
- 作用:将数据从源头送至目的
【2】Source
- 作用:负责接收数据到Flume Agent的组件,处理各种类型、各种格式的日志数据。
- avro、thrift、exec、jms、spooling directory、
- netcat、sequence generator、syslog、http、legacy
【3】Channel
- 作用:做缓冲区
- Memory Channel:内存中的队列,程序关闭或机器宕机的情况【**会**】丢失数据。
- File Channel:磁盘中的队列,程序关闭或机器宕机的情况【**不会**】丢失数据。
【4】Event
- 组成:header、byte array
- 作用:Flume 数据传输的基本单元
【5】Sink
- 作用:不断地轮询Channel中的事件,将这些事件批量写入到存储或索引系统、
发送数据到另一个Flume Agent
【2 Flume Agent 内部原理】
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a50c839353d421df11c0b6d063430c50.png)
【3 Flume 】
- 官网:http://flume.apache.org/
- 安装:
[root@localhost /]$ tar -zxvf xxxxxxxxxxxxx
[root@localhost /]$ vim ../conf/flume-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0
【4 Flume 实战开发】
- 配置文件官网:http://flume.apache.org/FlumeUserGuide.html
【1】监控端口数据