標籤:events 技術分享 lib mem localhost ons amd san connected
下載解壓到/usr/local/flume
配置環境變數
export FLUME_HOME=/usr/local/flumeexport FLUME_CONF_DIR=$FLUME_HOME/confexport PATH=.:$PATH::$FLUME_HOME/bin
在conf裡配置flume-env.sh 添加jdk路徑
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
flume-ng version
驗證是否安裝成功
[email protected]:~# flume-ng versionFlume 1.7.0Source code repository: https://git-wip-us.apache.org/repos/asf/flume.gitRevision: 511d868555dd4d16e6ce4fedc72c2d1454546707Compiled by bessbd on Wed Oct 12 20:51:10 CEST 2016From source with checksum 0d21b3ffdc55a07e1d08875872c00523
View Code
ps:如果報這錯java.lang.ClassNotFoundException: org.apache.flume.tools.GetJavaProperty
就將hbase的hbase.env.sh的一行配置注釋掉
#export HBASE_CLASSPATH=/xxx在conf裡建立single-node.conf
# example.conf: A single-node Flume configuration# Name the components on this agenta1.sources = r1a1.sinks = k1a1.channels = c1# Describe/configure the sourcea1.sources.r1.type = netcata1.sources.r1.bind = localhosta1.sources.r1.port = 44444# Describe the sinka1.sinks.k1.type = logger# Use a channel which buffers events in memorya1.channels.c1.type = memorya1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channela1.sources.r1.channels = c1a1.sinks.k1.channel = c1
View Code
運行
bin/flume-ng agent --conf conf --conf-file conf/single-node.conf --name a1 -Dflume.root.logger=INFO,console
另外開啟一個終端
telnet 127.0.0.1 44444
Trying 127.0.0.1...Connected to 127.0.0.1.Escape character is ‘^]‘.
View Code
然後在這邊隨便輸入內容,再去原來的終端觀察
Flume 1.7.0單機版安裝