flume 1.7在windows下的安裝與運行

來源:互聯網
上載者:User

標籤:capacity   image   主機名稱   設定檔   技術分享   window   example   解壓   amp   

flume 1.7在windows下的安裝與運行一、安裝
  1. 安裝java,配置環境變數。
  2. 安裝flume,flume的官網http://flume.apache.org/,,下載後直接解壓即可。
二、運行

建立設定檔:在解壓後的檔案apache-flume-1.6.0-bin/conf下建立一個example.conf,內容如下。

 # 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 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 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
配置說明:sources配置:
  • netcat 監控某個連接埠,將流經連接埠的每一個文本行資料作為Event輸入
  • bind中是要添加 ip地址或主機名稱
  • port中是要添加綁定主機的連接埠
Flume模組sinks配置:
  • a1.sinks.k1.type=logger logger資料寫入記錄檔(列印出來)
Flume模式channels配置:
  • a1.channels.c1.type=memory
  • a1.channels.c1.capacity=1000
  • a1.channels.c1.transactionCapacity=100
momory event資料存放區到記憶體中,快取資料1000 緩衝的資料是1000條100 每個事物緩衝的最大單元數目 Flume模組channel配置:(配置sources,sinks檔案與channel的關係)a1.sources.r1.channels=c1a1.sinks.k1.channel=c1 

2.1、開啟cmd進入到apache-flume-1.6.0-bin\bin目錄下,運行如下命令。

 flume-ng.cmd  agent -conf ../conf  -conf-file ../conf/example.conf  -name a1  -property flume.root.logger=INFO,console

(右鍵查看原圖):

 

2.2、另外開啟一個cmd視窗,運行如下命令。

telnet localhost 44444 

如果串連成功,則該視窗會變為輸入狀態,可以輸入文字。同時在步驟2中的cmd視窗中,也會顯示接收到的資訊。 (右鍵查看原圖):

 

 

flume 1.7在windows下的安裝與運行

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.