【问题标题】:channel lock error while configuring flume's multiple sources using FILE channels使用 FILE 通道配置水槽的多个源时出现通道锁定错误
【发布时间】:2017-02-01 15:48:25
【问题描述】:

使用 FILE 通道为代理配置多个源并引发锁定错误。下面是我的配置文件。

a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c3

#sources
a1.sources.r1.type=netcat
a1.sources.r1.bind=localhost
a1.sources.r1.port=4444

a1.sources.r2.type=exec
a1.sources.r2.command=tail -f /opt/gen_logs/logs/access.log

#sinks
a1.sinks.k1.type=hdfs
a1.sinks.k1.hdfs.path=/flume201
a1.sinks.k1.hdfs.filePrefix=netcat-
a1.sinks.k1.rollInterval=100
a1.sinks.k1.hdfs.fileType=DataStream
a1.sinks.k1.hdfs.callTimeout=100000


a1.sinks.k2.type=hdfs
a1.sinks.k2.hdfs.path=/flume202
a1.sinks.k2.hdfs.filePefix=execCommand-
a1.sinks.k2.rollInterval=100
a1.sinks.k2.hdfs.fileType=DataStream
a1.sinks.k2.hdfs.callTimeOut=100000

#channels
a1.channels.c1.type=file
a1.channels.c1.checkpointDir=/home/cloudera/alpha/001
a1.channels.c3.type=file
a1.channels.c3.checkpointDir=/home/cloudera/beta/001

#bind r1 c1 k1
a1.sources.r1.channels=c1
a1.sinks.k1.channel=c1

a1.sources.r2.channels=c3
a1.sinks.k2.channel=c3

我遇到了错误

Channel closed [channel=c3]. Due to java.io.IOException: Cannot lock /home/cloudera/.flume/file-channel/data. The directory is already locked. [channel=c3]

但是当我使用内存通道时。它工作正常。

【问题讨论】:

    标签: hadoop flume flume-ng


    【解决方案1】:

    我的猜测是您需要为每个频道指定不同的dataDirs 属性,因为它们都使用默认值

    【讨论】:

      【解决方案2】:

      来自docs

      默认情况下,文件通道使用检查点和数据的路径 上面指定的用户主目录中的目录。作为一个 如果您在其中有多个文件通道实例处于活动状态,则结果 代理,只有一个能够锁定目录并导致 其他通道初始化失败。因此有必要 您最好提供所有已配置通道的显式路径 在不同的磁盘上。

      频道的配置应该是,

      #channels
      a1.channels.c1.type=file
      a1.channels.c1.checkpointDir=/home/cloudera/alpha/001
      a1.channels.c1.dataDirs=/mnt/alpha_data/
      
      a1.channels.c3.type=file
      a1.channels.c3.checkpointDir=/home/cloudera/beta/001
      a1.channels.c3.dataDirs=/mnt/beta_data/
      

      dataDirs 属性默认为/home/user/.flume/file-channel/data 路径。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-05-28
        • 2014-12-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-04-09
        • 2016-12-25
        相关资源
        最近更新 更多