设为首页 加入收藏

TOP

Flume安装与第一个Agent应用
2019-01-16 14:05:28 】 浏览:72
Tags:Flume 安装 一个 Agent 应用
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/b_x_p/article/details/79184297

安装

(1)编辑flume-env.sh配置文件,配置javahome

export JAVA_HOME=/home/bxp/Documents/install/jdk1.8.0_131

(2)将flume与hdfs集成的jar包导入的到flume的lib目录下(自行度娘下载)。

命令

bin/flume-ng agent
global options(全局选项):
--conf 
-Dproperty=value
agent options(agent选项):
--name 
--conf-file
//示例:bin/flume-ng agent --conf conf/  --name agent-test --conf-file test.conf

第一个Agent应用

(1)安装并启动telnet,用于测试flume

sudo yum install telnet
sudo yum install telnet-server
sudo yum install xinetd
systemctl start xinetd

(2)创建a1.conf文件配置resoures,hannel,sink’

#define agent
a1.sources = r1
a1.channels = c1
a1.sinks = k1

# defined source 
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 55555

# defined channel
a1.channels.c1.type = memory
#设置channel的容量
a1.channels.c1.capacity = 1000
#设置sink每次从channel中拉取的event的数量
a1.channels.c1.transactionCapacity = 100

# defined sinks
a1.sinks.k1.type = logger
a1.sinks.k1.maxBytesToLog = 2014

#bind the sources and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

(3)启动flume

bin/flume-ng agent --conf conf/  --name a1 --conf-file conf/a1.conf -Dflume.root.logger=DEBUG,console

(4)启动telnet发送数据进行测试

telnet localhost 55555
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇大数据flume汇总 下一篇nginx ---->flume ----->ka..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目