flume hdfs rollSize не работает в многоканальном и многоканальном режимах

Я пытаюсь использовать Flume-ng, чтобы получить 128 МБ информации журнала и поместить ее в файл в HDFS. Но параметры прокатки HDFS не работают. Flume-ng отправляет файл журнала в секунду. Как исправить файл flume.conf?

agent01.sources = avroGenSrc
agent01.channels = memoryChannel hdfsChannel
agent01.sinks = fileSink hadoopSink

# For each one of the sources, the type is defined
agent01.sources.avroGenSrc.type = avro
agent01.sources.avroGenSrc.bind = dev-hadoop03.ncl
agent01.sources.avroGenSrc.port = 3333

# The channel can be defined as follows.
agent01.sources.avroGenSrc.channels = memoryChannel hdfsChannel

# Each sink's type must be defined
agent01.sinks.fileSink.type = file_roll
agent01.sinks.fileSink.sink.directory = /home1/irteam/flume/data
agent01.sinks.fileSink.sink.rollInterval = 3600
agent01.sinks.fileSink.sink.batchSize = 100

#Specify the channel the sink should use
agent01.sinks.fileSink.channel = memoryChannel



agent01.sinks.hadoopSink.type = hdfs
agent01.sinks.hadoopSink.hdfs.useLocalTimeStamp = true
agent01.sinks.hadoopSink.hdfs.path = hdfs://dev-hadoop04.ncl:9000/user/hive/warehouse/raw_logs/year=%Y/month=%m/day=%d
agent01.sinks.hadoopSink.hdfs.filePrefix = AccessLog.%Y-%m-%d.%Hh
agent01.sinks.hadoopSink.hdfs.fileType = DataStream
agent01.sinks.hadoopSink.hdfs.writeFormat = Text
agent01.sinks.hadoopSink.hdfs.rollInterval = 0
agent01.sinks.hadoopSink.hdfs.rollSize = 134217728
agent01.sinks.hadoopSink.hdfs.rollCount = 0

#Specify the channel the sink should use
agent01.sinks.hadoopSink.channel = hdfsChannel


# Each channel's type is defined.
agent01.channels.memoryChannel.type = memory
agent01.channels.hdfsChannel.type = memory

# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent01.channels.memoryChannel.capacity = 100000
agent01.channels.memoryChannel.transactionCapacity = 10000

agent01.channels.hdfsChannel.capacity = 100000
agent01.channels.hdfsChannel.transactionCapacity = 10000

person kkd927    schedule 24.08.2016    source источник


Ответы (1)


Я нашел это решение. Несоответствие dfs.replication вызывает эту проблему.

В моей конфигурации Hadoop (hadoop-2.7.2/etc/hadoop/hdfs-site.xml)

<property>
  <name>dfs.replication</name>
  <value>3</value>
</property>

У меня есть 2 узла данных, поэтому я меняю его на

<property>
  <name>dfs.replication</name>
  <value>2</value>
</property>

и добавляю конфиг в flume.conf

agent01.sinks.hadoopSink.hdfs.minBlockReplicas = 2

Спасибо за

https://qnalist.com/questions/5015704/hit-max-consecutive-under-replication-rotations-error

и

Приемник Flume HDFS продолжает накатывать небольшие файлы

person kkd927    schedule 24.08.2016