Flume:spooldir capture Log, Kafka output configuration issues

Source: Internet
Author: User

Flume configuration:

#DBFileDBFile. Sources = sources1  dbfile.sinks = sinks1  dbfile.channels = channels1    # Dbfile-db-source DBFile.sources.sources1.type = SpooldirDBFile.sources.sources1.spoolDir =/var/log/apache/flumespool// Dbdbfile.sources.sources1.inputcharset=utf-8  # dbfile-sink  DBFile.sinks.sinks1.type = Org.apache.flume.sink.kafka.KafkaSink  DBFile.sinks.sinks1.topic = DBFileDBFile.sinks.sinks1.brokerList = Hdp01 : 6667,hdp02:6667,hdp07:6667dbfile.sinks.sinks1.requiredacks = 1  DBFile.sinks.sinks1.batchSize =    # Dbfile-channeldbfile.channels.channels1.type = MemoryDBFile.channels.channels1.capacity = 10000dbfile.channels.channels1.transactioncapacity = 1000# Dbfile-source and Sink to the ChannelDBFile.sources.sources1.channels = Channels1DBFile.sinks.sinks1.channel = Channels1

Symptom: When uploading a file for the first time, Flume can quickly process the file, upload it later or show the file is not processed. If the flume service is restarted, it can be processed immediately.

After testing, the cause of the problem is on this configuration: DBFile.sinks.sinks1.requiredAcks =-1.

Requiredacks's official explanation: How many replicas must acknowledge a message before its considered successfully written. Accepted values is 0 (never wait for acknowledgement),

1 (wait for leader only),-1 (wait for any replicas) Set this to-1 to avoid data loss in some cases of leader failure.

It would be nice to change this value to 1.

Flume:spooldir capture Log, Kafka output configuration issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.