#jdk-8u111-linux-x64
export JAVA_HOME=/usr/local/jdk1.8.0_111
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATHlinux
cp ${FLUME_HOME}/conf/flume-conf.properties.template ${FLUME_HOME}/conf/exec.conf
cp ${FLUME_HOME}/conf/flume-env.sh.template ${FLUME_HOME}/conf/flume-env.shapache
vi flume-env.shoop
export JAVA_HOME=/usr/local/jdk1.8.0_111hadoop
vi exec.confci
a2.sources = r2
a2.sinks = k2
a2.channels = c2
# Describe/configure the source
a2.sources.r2.type = exec
a2.sources.r2.channels = c2
a2.sources.r2.command=tail -n +0 -F /usr/local/hadoop/flume/test.log
# Describe the sink
a2.sinks.k2.type = logger
# Use a channel which buffers events in memory
a2.channels.c2.type = memory
a2.channels.c2.capacity = 1000
a2.channels.c2.transactionCapacity = 100
# Bind the source and sink to the channel
a2.sources.r2.channels = c2
a2.sinks.k2.channel = c2kafka
#apache-flume-1.7.0-bin
export FLUME_HOME=/root/flume
export PATH=${FLUME_HOME}/bin:$PATHit
flume-ng agent --conf /root/flume/conf/ -f /root/flume/conf/exec.conf -Dflume.root.logger=DEBUG,console -n a2
#http 監控
nohup flume-ng agent --conf conf --conf-file /data/apache-flume-1.6.0-cdh5.10.0-bin/conf/dirfile_to_kafa_conf.properties --name agent -Dflume.monitoring.type=http -Dflume.monitoring.port=86668 & >/dev/nullio
#kafka_2.11-0.9.0.1
export KAFKA_HOME=/root/kafka
export PATH=${KAFKA_HOME}/bin:$PATHconsole
http監控參數:
1,SOURCE
OpenConnectionCount (打開的鏈接數)
Type (組件類型)
AppendBatchAcceptedCount (追加到channel中的批數量)
AppendBatchReceivedCount (source端剛剛追加的批數量)
EventAcceptedCount (成功放入channel的event數量)
AppendReceivedCount (source追加收到的數量)
StartTime (組件開始時間)
StopTime (組件中止時間)
EventReceivedCount (source端成功收到的event數量)
AppendAcceptedCount (追加到channel的數量)event
2,CHANNEL
EventPutSuccessCount (成功放入channel的event數量)
ChannelFillPercentage (通道使用比例)
Type (組件類型)
EventPutAttemptCount (嘗試放入將event放入channel的次數)
ChannelSize (channel中的event數量)
StartTime (組件開始時間)
StopTime (組件中止時間)
EventTakeSuccessCount (從channel中成功取走的event數量)
ChannelCapacity (通道容量)
EventTakeAttemptCount (嘗試從channel中取走event的次數)
3,SINK BatchCompleteCount (完成的批數量)、 ConnectionFailedCount (鏈接失敗數)、 EventDrainAttemptCount (嘗試提交的event數量)、 ConnectionCreatedCount (建立鏈接數)、 Type (組件類型)、 BatchEmptyCount (批量取空的數量)、 ConnectionClosedCount (關閉鏈接數量)、 EventDrainSuccessCount (成功發送event的數量)、 StartTime (組件開始時間)、 StopTime (組件中止時間)、 BatchUnderflowCount (正處於批量處理的batch數) RollbackCount(回滾的數量)