1、安装JDK并配置环境变量
2、下载flume1.8并放到C盘中解压
3、进入到conf目录下
4、重命名文件
5、复制一下代码到flume.conf中覆盖
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
# sink
a1.sinks.k1.type = logger
# channel
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
6、在DOS中启动flume
cd C:\apache-flume-1.8.0-bin\apache-flume-1.8.0-bin\bin
flume-ng.cmd agent -conf-file ../conf/flume.conf -name a1 -property flume.root.logger=INFO,console
7、新打开一个DOS窗口,输入
telnet localhost 44444
进入输入框就可以开始发送消息了(localhost 为本地IP映射名)
8、本机测试成功