- flume安装下载,解压flume文件
cd flume/conf
cp flume-conf.properties.template flume-conf.properties
cp flume-env.sh.template flume-env.sh
vi flume-env.sh
export JAVA_HOME=/usr/java
- flume简单编辑
mkdir conf-self
vi flume-test.conf
#agent:代理名 (任意起名)
#配置sources源名称,配置sinks名称,配置channels名称
agent.sources=a1
agent.sinks=s1
agent.channels=c1
#配置sources,type必须配置,配置逻辑规则为:
#<agent>.sources.<sources>.type=
agent.sources.a1.type=netcat
agent.sources.a1.bind=localhost
agent.sources.a1.port=44444
#配置channels,type必须配置
#<agent>.channels.<channels>.type=
agent.channels.c1.type=memory
agent.channels.c1.transactionCapacity=100
#配置sinks,type必须配置
#<agent>.sinks.<sinks>.type=
agent.sinks.s1.type=logger
#sources,sinks绑定channels
#配置规则:
#<agent>.sources.<sources>.channels=
agent.sources.a1.channels=c1
#注意:sources-channels,而sinks为channel
#<agent>.sinks.<sinks>.channel=
agent.sinks.s1.channel=c1
3.flume运行
./bin/flume-ng -agent --conf conf --conf-file conf-self/flume-test.conf --name agent -Dflume.root.logger=INFO,console
- 测试结果
telnet localhost 44444
helloword
运行截图: