首页 > 其他分享 >大数据学习之flume(一)

大数据学习之flume(一)

时间:2023-03-07 13:46:21浏览次数:34  
标签:flume a1 r1 学习 sources conf c1 数据

1、安装java

2、安装flume,上传压缩包,解压

3、修改conf

cp flume-env.sh.template flume-env.sh

vi flume-env.sh

修改javahome位置

4、测试:flume-ng version

使用向导:https://flume.apache.org/releases/content/1.11.0/FlumeUserGuide.html

配置source,sink,channel,再把三者做关联

创建一个配置文件:example.conf

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# 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

启动命令:flume-ng agent --name a1 --conf $FLUME_HOME/conf --conf-file $FLUME_HOME/conf/example.conf -Dflume.root.logger=INFO,console

 启动之后,用另一个控制台telnet访问,然后输入一些文字,就可以在当前控制台看到端口输入的信息了。

 

 

 

标签:flume,a1,r1,学习,sources,conf,c1,数据
From: https://www.cnblogs.com/dongzhensd/p/17180003.html

相关文章