Flume的安裝與使用

來源:互聯網
上載者:User

標籤:bin   root   列印   cap   localtime   div   local   控制   bsp   

Flume下載後,解壓,新增一個設定檔,寫入配置即可

我將設定檔寫在 conf 下,取名為 flume-conf-spooldir.properties

Flume 運行命令:

bin/flume-ng agent --conf conf --conf-file conf/flume-conf-spooldir.properties --name LogAgent -Dflume.root.logger=DEBUG,console

其中,

-Dflume.root.logger=DEBUG,console 純粹是為了在控制台列印而加的,非必須

 

之後在/tmp/logs 目錄下,放入一個檔案,即可看到運行效果

根據此設定檔,會有的效果:

1、hdfs中有 /tmp/logs 放入的檔案

2、/tmp/logs 中放入的檔案有一個尾碼名.complete

 

註:要保證 HDFS 是啟動起來的

 

設定檔的內容為:

LogAgent.sources = mysourceLogAgent.channels = mychannelLogAgent.sinks = mysinkLogAgent.sources.mysource.type = spooldirLogAgent.sources.mysource.channels = mychannelLogAgent.sources.mysource.spoolDir =/tmp/logsLogAgent.sinks.mysink.channel = mychannelLogAgent.sinks.mysink.type = hdfsLogAgent.sinks.mysink.hdfs.path = hdfs://node1:9000/data/logs/%Y/%m/%d/%H/LogAgent.sinks.mysink.hdfs.batchSize = 1000LogAgent.sinks.mysink.hdfs.rollSize= 0LogAgent.sinks.mysink.hdfs.rollCount = 10000LogAgent.sinks.mysink.hdfs.useLocalTimeStamp = trueLogAgent.channels.mychannel.type = memoryLogAgent.channels.mychannel.capacity = 10000LogAgent.channels.mychannel.transactionCapacity = 100

 

Flume的安裝與使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.