Hadoop生态Flume(二)安装配置
生活随笔
收集整理的這篇文章主要介紹了
Hadoop生态Flume(二)安装配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
一、flume下載地址
列中的鏈接應顯示可用鏡像的列表,并根據您的推斷位置進行默認選擇。如果看不到該頁面,請嘗試使用其他瀏覽器。校驗和和簽名是主分發服務器上原始文件的鏈接。
| Apache Flume二進制文件(tar.gz) | apache-flume-1.9.0-bin.tar.gz | apache-flume-1.9.0-bin.tar.gz.sha512 | apache-flume-1.9.0-bin.tar.gz.asc |
| Apache Flume來源(tar.gz) | apache-flume-1.9.0-src.tar.gz | apache-flume-1.9.0-src.tar.gz.sha512 | apache-flume-1.9.0-src.tar.gz.asc |
必須使用PGP或MD5簽名來驗證下載文件的完整性。
flume1.9.0下載地址
?
二、安裝環境
?
三、配置
(1)解壓安裝
cp apache-flume-1.9.0-bin.tar.gz /home/mk tar -zxvf apache-flume-1.9.0-bin.tar.gz cd apache-flume-1.9.0-bin(2)配置
cp conf/flume-conf.properties.template conf/flume.confflume.conf?
# Define a memory channel called ch1 on agent1 agent1.channels.ch1.type = memory# Define an Avro source called netcat-source1 on agent1 and tell it # to bind to 0.0.0.0:12200. Connect it to channel ch1. agent1.sources.netcat-source1.channels = ch1 agent1.sources.netcat-source1.type = netcat agent1.sources.netcat-source1.bind = 0.0.0.0 agent1.sources.netcat-source1.port = 12200# Define a logger sink that simply logs all events it receives # and connect it to the other end of the same channel. agent1.sinks.log-sink1.channel = ch1 agent1.sinks.log-sink1.type = logger# Finally, now that we've defined all of our components, tell # agent1 which ones we want to activate. agent1.channels = ch1 agent1.sources = netcat-source1 agent1.sinks = log-sink1(3)(可選)基于模板創建flume-env.sh文件(或從頭開始創建一個文件)。flume-ng可執行文件在--conf / -c命令行選項指定的conf目錄中查找并獲取名為“ flume-env.sh”的文件。使用flume-env.sh的一個用例是在開發自己的自定義Flume NG組件(例如源和接收器)時通過JAVA_OPTS指定調試或概要分析選項。
| $ cp conf/flume-env.sh.template conf/flume-env.sh |
(4)運行Flume NG
flume-ng可執行文件使您可以運行Flume NG代理或Avro客戶端,這對于測試和實驗非常有用。無論如何,您都需要指定一個命令(例如agent)和一個conf目錄(--conf <conf dir>)。所有其他選項都是特定于命令的。
要使用上面的flume.conf啟動flume服務器:
bin/flume-ng agent --conf ./conf/ -f conf/flume.conf -Dflume.root.logger=DEBUG,console -n agent1 -Dflume.monitoring.type=http -Dflume.monitoring.port=23310請注意,agent名稱由指定,-n agent1并且必須與配置中指定的agent名稱匹配-f conf/flume.conf
測試:
$ telnet localhost 12200 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. Hello world! <ENTER> OK輸出日志:
?
總結
以上是生活随笔為你收集整理的Hadoop生态Flume(二)安装配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 超好听的名字 超好听的名字分享
- 下一篇: 七国集团是哪几个国家 七国集团有中国吗