vi flume.conf
############################################################# Configure for Flume Agent (Gateway Log Agent)#########################################################agentA.sources = gwSourceagentA.channels = gwChannelagentA.sinks = gwSink############################################## Configure for Source########################################### For each one of the sources, the type is definedagentA.sources.gwSource.type = execagentA.sources.gwSource.command = tail -Fs 180 /home/yusbha/nginx/logs/access.logagentA.sources.gwSource.restart = trueagentA.sources.gwSource.restartThrottle=1000agentA.sources.gwSource.interceptors = i1agentA.sources.gwSource.interceptors.i1.type = timestampagentA.sources.gwSource.channels = gwChannel############################################## Configure for Channel########################################### Each channel's type is defined.agentA.channels.gwChannel.type = fileagentA.channels.gwChannel.dataDirs = /home/yusbha/flume/file-channel/data/01agentA.channels.gwChannel.checkpointDir = /home/yusbha/flume/file-channel/checkpoint/01agentA.channels.gwChannel.maxFileSize=524288000agentA.channels.gwChannel.checkpointInterval=10000agentA.channels.gwChannel.transactionCapacity=1000############################################## Configure for Sink########################################### Each sink's type must be definedagentA.sinks.gwSink.type = avroagentA.sinks.gwSink.hostname = 172.27.106.48agentA.sinks.gwSink.port = 35853agentA.sinks.gwSink.channel = gwChannel
Flume Agent 실행 Command
bin/flume-ng agent --conf conf --conf-file conf/flume.conf --name agentA -Dflume.root.logger=INFO,console
[Flume Collector]
vi flume.conf
############################################################# Configure for Flume Agent (Gateway Log Collector)#########################################################collector.sources = collectorSourcecollector.channels = collectorChannelcollector.sinks = HDFS############################################## Configure for Source : 172.27.106.48########################################### For each one of the sources, the type is defined.collector.sources.collectorSource.type = avrocollector.sources.collectorSource.bind = 0.0.0.0collector.sources.collectorSource.port = 35853collector.sources.collectorSource.channels = collectorChannel############################################## Configure for Channel##########################################collector.channels.collectorChannel.type = memory#collector.channels.collectorChannel.type = file#collector.channels.collectorChannel.dataDirs = /home/hadoop/flume/file-channel/data/01#collector.channels.collectorChannel.checkpointDir = /home/hadoop/flume/file-channel/checkpoint/01#collector.channels.collectorChannel.transactionCapacity = 1000#collector.channels.collectorChannel.checkpointInterval = 30000#collector.channels.collectorChannel.maxFileSize = 2146435071#collector.channels.collectorChannel.minimumRequiredSpace = 524288000#collector.channels.collectorChannel.keep-alive = 5#collector.channels.collectorChannel.write-timeout = 10#collector.channels.collectorChannel.checkpoint-timeout = 600#collector.channels.collectorChannel.capacity = 500000############################################## Configure for Sink########################################### Each sink's type must be definedcollector.sinks.HDFS.type = hdfscollector.sinks.HDFS.hdfs.path = hdfs://name.odp.kt.com/logscollector.sinks.HDFS.hdfs.filePrefix = %Y%m%d%H%M%Scollector.sinks.HDFS.hdfs.fileType = DataStreamcollector.sinks.HDFS.hdfs.fileSuffix = .logcollector.sinks.HDFS.hdfs.inUseSuffix = .workcollector.sinks.HDFS.hdfs.maxOpenFiles = 200collector.sinks.HDFS.hdfs.rollSize = 0collector.sinks.HDFS.hdfs.rollInterval = 60collector.sinks.HDFS.hdfs.rollCount = 0collector.sinks.HDFS.hdfs.rollTimerPoolSize = 1collector.sinks.HDFS.hdfs.batchSize = 100collector.sinks.HDFS.hdfs.threadsPoolSize = 1collector.sinks.HDFS.hdfs.callTimeout = 60000collector.sinks.HDFS.hdfs.writeFormat = TEXTcollector.sinks.HDFS.serializer = textcollector.sinks.HDFS.serializer.appendNewline = truecollector.sinks.HDFS.channel = collectorChannel
Flume Agent 실행 Command
bin/flume-ng agent --conf conf --conf-file conf/flume.conf --name collector -Dflume.root.logger=INFO,console
댓글을 달아 주세요
댓글 RSS 주소 : http://www.yongbi.net/rss/comment/580