flume入門

# example.conf: A single-node Flume configuration# Name the components on this agent
#給那三個組件取個名字
a1.sources = r1
a1.sinks = k1
a1.channels = c1# Describe/configure the source
#類型, 從網絡端口接收數據,在本機啟動, 所以localhost, type=spoolDir采集目錄源,目錄里有就采
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444# Describe the sink
a1.sinks.k1.type = logger# Use a channel which buffers events in memory
#下沉的時候是一批一批的, 下沉的時候是一個個eventChannel參數解釋:
#capacity:默認該通道中最大的可以存儲的event數量
#trasactionCapacity:每次最大可以從source中拿到或者送到sink中的event數量
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1啟動命令:
#告訴flum啟動一個agent,指定配置參數, --name:agent的名字,
$ bin/flume-ng agent --conf conf --conf-file conf/netcat-logger.conf --name a1 -Dflume.root.logger=INFO,console

首先要啟動hdfs,

使用telnet通信就可以做測試,如果是其他機器訪問的那么netcat要配置成ip而不是localhost,netcat默認讀取字符長度是16個數字,可以設置更大

?啟動flume 之后?telnet mini2 44444?

文件系統 到hdfs

agent1.sources=source1
agent1.sinks=sink1
agent1.channels=channel1
#source1
agent1.sources.source1.type=spooldir
agent1.sources.source1.spoolDir=/home/hadoop/flume/test/logs
agent1.sources.source1.channels=channel1
agent1.sources.source1.fileHeader=false
agent1.sources.source1.interceptors?=?i1
agent1.sources.source1.interceptors.i1.type?=?timestamp
#sink1
agent1.sinks.sink1.type=hdfs
agent1.sinks.sink1.hdfs.path=hdfs://mini1:9000/flume/data
agent1.sinks.sink1.hdfs.fileType=DataStream
agent1.sinks.sink1.hdfs.writeFormat=TEXT
agent1.sinks.sink1.hdfs.rollInterval=1
agent1.sinks.sink1.hdfs.useLocalTimeStamp = true
agent1.sinks.sink1.channel=channel1
agent1.sinks.sink1.hdfs.filePrefix=%Y-%m-%d
#配置channel1
agent1.channels.channel1.type=file
agent1.channels.channel1.checkpointDir=/home/hadoop/flume/channel_data.backup
agent1.channels.channel1.dataDirs=/home/hadoop/flume/channel_data                                     

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541229.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541229.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541229.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

原生js設置div隱藏或者顯示_JavaScript動畫方式控制div元素的隱藏和顯示

jQuery實現此功能相對比較簡單,具體參閱點擊按鈕動畫方式隱藏和顯示div一章節。結合CSS3實現此功能也非常便利和適合,具體參閱JavaScript與CSS3動畫方式改變元素尺寸一章節。原生JavaScript實現稍顯麻煩,下面就通過代碼實例介紹一下如何實現此…

python線程任務run_Python線程類| 帶有示例的run()方法

python線程任務runPython Thread.run()方法 (Python Thread.run() Method) Thread.run() method is an inbuilt method of the Thread class of the threading module in Python. This method is used to represent a threads activity. It calls the method expressed as the …

哪個計算機無法做到雙屏顯示,怎么啟用雙屏顯示設置【圖文介紹】

隨著生活質量的提升,人們對于便利的要求越來越高,電腦的雙屏顯示成為現在用戶越來越關注的對象之一。比如炒股操作中,人們既要關注大盤的走動趨勢,又要關注特定股票的走勢,在普通的屏幕上就需要不斷地切換頁面&#xf…

1.django 開發環境搭建

2019獨角獸企業重金招聘Python工程師標準>>> 本教程使用的開發環境 本教程寫作時開發環境的系統平臺為 Windows 10 (64 位),Python 版本為 3.5.2 (64 位),Django 版本為 1.10.6。 建議盡可能地與…

改jpg_|我來改第04期|—人物海報設計

【我來改第04期】人物海報文案內容-Ad copyhttps://pan.baidu.com/s/16pz9_rcLXTGZ3xzKFjKN9g 密碼: r57t設計要求-Requirement尺寸:1080(高)*650(寬)像素,大小不大于5m設計要求:以目前的藍色為主要顏色(R:47,G:87,B:130),畫面體…

Java即時類| plus()方法與示例

即時類plus()方法 (Instant Class plus() method) Syntax: 句法: public Instant plus(TemporalAmount t_amt);public Instant plus(long amt, TemporalUnit t_unit);plus() method is available in java.time package. plus()方法在java.time包中可用。 plus(Temp…

計算機領域中dns是什么意思,dns錯誤是什么意思?dns錯誤要如何解決?

隨著網絡的普及,電腦已經成為我們生活中必不可少的物品,它可以幫助我們工作和學習以及娛樂。不過電腦在使用的過程中,常常會出現一些問題,小編覺得最常見也最讓人心生煩躁的就是輸入網址打開之后出現網頁打不開,提示dn…

Launch Instruments

Launch Instruments 該儀器應用在Xcode應用程序,所以推出是在Xcode的最直接的方式。你也可以啟動它間接地通過碼頭,啟動,或命令行。The Instruments app lives inside the Xcode app, so the most direct way to launch it is from within Xc…

java clock計時_Java Clock類| offset()方法與示例

java clock計時Clock Class offset()方法 (Clock Class offset() method) offset() method is available in java.time package. offset()方法在java.time包中可用。 offset() method is used to generate a new Clock from the given base clock with added the given Duratio…

dataframe數據標準化處理_數據處理中的標準化、歸一化究竟是什么?

關注上方“Python數據科學”,選擇星標,精彩文章不會錯過!今天說一個比較重要的內容,無論是在算法建模還是在數據分析都比較常見:數據歸一化和標準化。開始之前,請你先把網上看到的所有相關的博客、帖子都忘…

北航計算機學院博士機試考試題,北航2015考博真題回憶及全套資料 - 考博 - 小木蟲 - 學術 科研 互動社區...

我是2015年畢業的應屆碩士,報考了北航經管院的博士。想寫這篇文很久了,現在復試完等最后結果中,把自己一路走來的經驗分享給大家。1.報名報名之前很重要的一點就是聯系導師。我是研二下,快放暑假了才開始聯系導師。北航一般是11月…

用了Redis里面的map和set

map的操作用 hset,hget等 set的操作有 sadd sismember等 參考下面: http://blog.csdn.net/kwsy2008/article/details/48467441

java輸出不同顏色_Java設計模式-策略模式、狀態模式

推薦閱讀:一只Tom貓:都是“Redis惹的禍”,害我差點掛在美團三面,真是“虛驚一場”!java喵:6大面試技能樹:JAVA基礎JVM算法數據庫計算機網絡操作系統前言當代碼中出現多重if-else語句或者switch語…

c++stl和std_std :: rotate()函數以及C ++ STL中的示例

cstl和stdC STL std :: rotate()函數 (C STL std::rotate() function) rotate() function is a library function of algorithm header, it is used to rotate left the elements of a sequence within a given range, it accepts the range (start, end) and a middle point,…

計算機硬盤正在工作應特別注意避免,初級計算機考試題庫

計算機的初級基本*作包括基本信息欄、計算機的基礎知識、五筆字型基礎、*互聯網的*作、常用辦公外設的使用、計算機硬件的日常維護與保養和office辦公工具的應用。下面是初級計算機考試題庫,請參考!1.以下與信息有關的設備計算中,用于存儲信息…

abap 添加alv上的工具欄的按鈕_神器必會!“世界上最好的編輯器Source Insight”...

前言“Source Insight(以下簡稱SI)是世界上最好的編輯器”,說這句話不知道會不會出門被打呢?-_- 中國古話說得好,“文無第一,武無第二”,所以不敢說SI是最好的,但是說是“最好的之一”絕對是妥妥的。它以豐…

SLF4J with Logback in a Maven Project | Mograblog

SLF4J with Logback in a Maven Project | Mograblog

Ruby中帶有示例的Hash.key?(value)方法

Hash.key?(value)方法 (Hash.key?(value) Method) In this article, we will study about Hash.key?(value) Method. The working of the method cant be assumed because its quite a different name. Let us read its definition and understand its implementa…

計算機課傷害事故的防范,體育課安全傷害事故的防范與處理

摘 要:近年來,在教育改革的背景下,學校方面特別重視體育教學這一環節。做好體育教學工作,一方面能夠使學生達到強身健體的目的,另一方面能夠使學生的綜合素質水平得到有效提升。然而,在體育課中還會發生一些…

同一個容器實例可以同時運行在多個宿主機_從零開始學K8s: 3.什么是容器

Kubernetes使用Linux容器技術來實現應用的隔離。因此在深入學習k8s之前,我們需要先學習容器的基礎知識以便更好地去理解k8s的原理機制。揭開容器的神秘面紗當一個應用只由較少數量的大組件構成時,完全可以給每個組件分配一個專用的虛擬機,以及…