Flume基本配置


Flume的使用只需要做一些简短的配置即可,而且在apache官方网站上也都给出了基本使用。

1、Flume下载
apache-flume-1.7.0-bin.tar.gz

注意:Windown安装也是用这个包。

2、Flume安装

cd /root/soft
tar -zxvf apache-flume-1.7.0-bin.tar.gz


3、建立Flume配置文件:vim /root/soft/apache-flume-1.7.0-bin/conf/flume.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

 

4、启动Flume

cd /root/soft/apache-flume-1.7.0-bin/bin
./flume-ng agent --conf ../conf/ --conf-file ../conf/flume.conf --name a1 -Dflume.root.logger=INFO,console

 

控制台出现如下信息,表示flume启动成功。

2020-07-01 16:55:17,423 (lifecycleSupervisor-1-2) [INFO - org.apache.flume.source.NetcatSource.start(NetcatSource.java:155)] Source starting
2020-07-01 16:55:17,432 (lifecycleSupervisor-1-2) [INFO - org.apache.flume.source.NetcatSource.start(NetcatSource.java:169)] Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:44444]

 

5、使用telnet命令进行flume测试

telnet localhost 44444

 

此时通过telnet输入的数据可以自动发送到flume服务器上。

posted on 2020-07-01 17:03  Ruthless  阅读(948)  评论(0编辑  收藏  举报