flume安装
1. 下载apache-flume-1.9.0-bin.tar
2. 放到/usr/lib/flume(需要chmod 777),并解压
3. 设置PATH(/etc/profile)
export FLUME_HOME=/usr/lib/flume/apache-flume-1.9.0-bin export FLUME_CONF_DIR=$FLUME_HOME/conf export PATH=.:$PATH::$FLUME_HOME/bin source /etc/profile
注意:此时可以在任何目录下使用flume-ng version查看版本。
4. 配置agent配置文件
在conf/
cp flume-conf.properties.template flume-conf.properties
5. 配置文件如下
a1.sources = r1 a1.sinks = k1 a1.channels = c1 a1.sources.r1.type = netcat a1.sources.r1.bind = localhost a1.sources.r1.port = 44444 a1.sinks.k1.type = logger a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100 a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1
5. 运行
./bin/flume-ng agent –c conf -f conf/flume-conf.properties –n a1 -Dflume.root.logger=INFO,console
可看到Created serverSocket:
解析:–n a1中的a1对应配置文件中的a1
注意1:flume-ng agent启动需要使用路径,否则失败(如果要指定flume-ng路径,那么PATH配置有什么用?)
注意2: flume-env.sh不需要配置
flume安装
[db:回答]