標籤:capacity image 主機名稱 設定檔 技術分享 window example 解壓 amp
flume 1.7在windows下的安裝與運行一、安裝
- 安裝java,配置環境變數。
- 安裝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下的安裝與運行