新闻实时分析系统-Flume数据采集准备
Flume是Cloudera提供的一个高可用的,高可靠的,分布式的海量日志采集、聚合和传输的系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据;同时,Flume提供对数据进行简单处理,并写到各种数据接受方(可定制)的能力。
1.flume节点服务设计
2.下载Flume并安装
1)下载Apache版本的Flume。
2)下载Cloudera版本的Flume。
3)这里选择下载Apache版本的apache-flume-1.7.0-bin.tar.gz ,然后上传至bigdata-pro01.kfk.com节点/opt/softwares/目录下
4)解压Flume
tar -zxf apache-flume-1.7.0-bin.tar.gz -C /opt/modules/
5)将flume分发到其他两个节点
scp -r flume-1.7.0-bin bigdata-pro02.kfk.com:/opt/modules/
scp -r flume-1.7.0-bin bigdata-pro03.kfk.com:/opt/modules/
3.flume agent-1采集节点服务配置
1)bigdata-pro02.kfk.com节点配置flume,将数据采集到bigdata-pro01.kfk.com节点
vi flume-conf.properties
agent2.sources = r1
agent2.channels = c1
agent2.sinks = k1
agent2.sources.r1.type = exec
agent2.sources.r1.command = tail -F /opt/datas/weblogs.log
agent2.sources.r1.channels = c1
agent2.channels.c1.type = memory
agent2.channels.c1.capacity = 10000
agent2.channels.c1.transactionCapacity = 10000
agent2.channels.c1.keep-alive = 5
agent2.sinks.k1.type = avro
agent2.sinks.k1.channel = c1
agent2.sinks.k1.hostname = bigdata-pro01.kfk.com
agent2.sinks.k1.port = 5555
2)bigdata-pro03.kfk.com节点配置flume,将数据采集到bigdata-pro01.kfk.com节点
vi flume-conf.properties
agent3.sources = r1
agent3.channels = c1
agent3.sinks = k1
agent3.sources.r1.type = exec
agent3.sources.r1.command = tail -F /opt/datas/weblogs.log
agent3.sources.r1.channels = c1
agent3.channels.c1.type = memory
agent3.channels.c1.capacity = 10000
agent3.channels.c1.transactionCapacity = 10000
agent3.channels.c1.keep-alive = 5
agent3.sinks.k1.type = avro
agent3.sinks.k1.channel = c1
agent3.sinks.k1.hostname = bigdata-pro01.kfk.com
agent3.sinks.k1.port = 5555