flume断点续传配置

  1. flume-1.6

    a1.sources = r1 r2 r3
    a1.sinks = k1
    a1.channels = c1
    
    a1.sources.r1.type = exec
    a1.sources.r1.shell = /bin/bash -c
    //注意先要 `echo 0 > /root/data/log1 `
    a1.sources.r1.command = tail -n +$(tail -n1 /root/data/log1) -F /var/log/hd_access.log  | awk 'ARGIND==1{i=$0;next}{i++;if($0~/^tail/){i=0};print $0;print i >> "/root/data/log1";fflush("")}' /root/data/log1 -
    a1.sources.r1.interceptors = i1
    a1.sources.r1.interceptors.i1.type = static
    a1.sources.r1.interceptors.i1.key = type
    a1.sources.r1.interceptors.i1.value = hd-access
    
    a1.sources.r2.type = exec
    a1.sources.r2.shell = /bin/bash -c  #重要
    a1.sources.r3.command = tail -n +$(tail -n1 /root/data/log2) -F /var/log/m_access.log  | awk 'ARGIND==1{i=$0;next}{i++;if($0~/^tail/){i=0};print $0;print i >> "/root/data/log2";fflush("")}' /root/data/log2 -
    a1.sources.r2.interceptors = i2
    a1.sources.r2.interceptors.i2.type = static
    a1.sources.r2.interceptors.i2.key = type
    a1.sources.r2.interceptors.i2.value = m-access
    
    a1.sources.r3.type = exec
    a1.sources.r3.shell = /bin/bash -c
    a1.sources.r3.command = tail -n +$(tail -n1 /root/data/log3) -F /var/log/pc_access.log  | awk 'ARGIND==1{i=$0;next}{i++;if($0~/^tail/){i=0};print $0;print i >> "/root/data/log3";fflush("")}' /root/data/log3 -
    a1.sources.r3.interceptors = i3
    a1.sources.r3.interceptors.i3.type = static
    a1.sources.r3.interceptors.i3.key = type
    a1.sources.r3.interceptors.i3.value = pc-access
    
    a1.sinks.k1.type = logger
    #a1.sinks.k1.type = avro
    #a1.sinks.k1.hostname = 172.16.10.190
    #a1.sinks.k1.port = 4444
    
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 100000
    a1.channels.c1.transactionCapacity = 10000
    
    a1.sources.r1.channels = c1
    a1.sources.r2.channels = c1
    a1.sources.r3.channels = c1
    a1.sinks.k1.channel = c1
    
    
  2. flume-1.7

    a1.sources = r1 r2 r3
    a1.sinks = k1
    a1.channels = c1
    	
    a1.sources.r1.type = TAILDIR
    a1.sources.r1.positionFile = /flume-test/taildir_position.json
    a1.sources.r1.filegroups = f1 f2 f3
    	
    a1.sources.r1.type = TAILDIR
    a1.sources.r1.positionFile =/flume-test/taildir_position_r1.json
    a1.sources.r1.filegroups = f1
    a1.sources.r1.filegroups.f1 = /var/log/hd_access.log
    a1.sources.r1.interceptors = i1
    a1.sources.r1.interceptors.i1.type = com.hnb.data.immi.flume.interceptor.ImmiNginxLogInterceptor$Builder
    a1.sources.r1.interceptors.i1.logType = hd-access
    	
    a1.sources.r2.type = TAILDIR
    a1.sources.r2.positionFile = /opt/cdh/flume-test/taildir_position_r2.json
    a1.sources.r2.filegroups = f2
    a1.sources.r2.filegroups.f2 = /var/log/m_access.log
    a1.sources.r2.interceptors = i2
    a1.sources.r2.interceptors.i2.type = com.hnb.data.immi.flume.interceptor.ImmiNginxLogInterceptor$Builder
    a1.sources.r2.interceptors.i2.logType = m-access
                
    a1.sources.r3.type = TAILDIR
    a1.sources.r3.positionFile = /opt/cdh/flume-test/taildir_position_r3.json
    a1.sources.r3.filegroups = f3
    a1.sources.r3.filegroups.f3 = /var/log/pc_access.log
    a1.sources.r3.interceptors = i3
    a1.sources.r3.interceptors.i3.type = com.hnb.data.immi.flume.interceptor.ImmiNginxLogInterceptor$Builder
    a1.sources.r3.interceptors.i3.logType = pc-access
    
    a1.sinks.k1.type = logger
    #a1.sinks.k1.type = avro
    #a1.sinks.k1.hostname = 172.16.10.190
    #a1.sinks.k1.port = 4444
    	
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 100000
    a1.channels.c1.transactionCapacity = 10000
    
    a1.sources.r1.channels = c1
    a1.sources.r2.channels = c1
    a1.sources.r3.channels = c1
    a1.sinks.k1.channel = c1	
    
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值