您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“Storm On Yarn的安裝和部署”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
1. 安裝 JDK7 和 Maven
2. 部署Hadoop2集群,并啟動yarn
http://my.oschina.net/zc741520/blog/362824
3. 下載 Storm on Yarn
[grid@hadoop4 ~]$ wget https://github.com/yahoo/storm-yarn/archive/master.zip
4. 編譯
[grid@hadoop4 ~]$ unzip master.zip [grid@hadoop4 ~]$ cd storm-yarn-master ## 修改 pom.xml,將Hadoop的版本號改成對應(yīng)的版本號 [grid@hadoop4 storm-yarn-master]$ vim pom.xml <properties> <storm.version>0.9.0-wip21</storm.version> <hadoop.version>2.5.2</hadoop.version> <!--hadoop.version>2.1.0.2.0.5.0-67</hadoop.version--> </properties> ## 編譯 [grid@hadoop4 storm-yarn-master]$ mvn package -DskipTests
5. storm-yarn-master/lib/storm-0.9.0-wip21.zip 解壓到上層目錄storm-yarn-master中
[grid@hadoop4 storm-yarn-master]$ cd lib [grid@hadoop4 lib]$ unzip storm-0.9.0-wip21.zip -d .. [grid@hadoop4 storm-yarn-master]$ ls bin CLA.pdf create-tarball.sh lib LICENSE.txt pom.xml README.md src storm-0.9.0-wip21 target
6. 在HDFS中創(chuàng)建對應(yīng)Storm目錄
[grid@hadoop4 storm-yarn-master]$ hadoop fs -mkdir -p /lib/storm/0.9.0-wip21
7. 將storm.zip放到HDFS
## 根據(jù)實(shí)際需要,添加Storm工程需要的額外Jar包到storm-0.9.0-wip21的lib下,重新壓縮成storm.zip文件,上傳至HDFS的指定目錄中(非常重要,集群中通過訪問hdfs中的storm.zip獲取工作環(huán)境)
[grid@hadoop4 storm-yarn-master]$ hadoop fs -put ./lib/storm.zip /lib/storm/0.9.0-wip21 [grid@hadoop4 storm-yarn-master]$ hadoop fs -ls /lib/storm/0.9.0-wip21 Found 1 items -rw-r--r-- 2 grid supergroup 17141078 2015-05-24 19:43 /lib/storm/0.9.0-wip21/storm.zip
8. 在安裝Hadoop時(shí)已經(jīng)設(shè)置好了hadoop的一些環(huán)境變量,現(xiàn)在再增加如下環(huán)境變量
[grid@hadoop4 storm-yarn-master]$ vim ~/.bash_profile export PATH=$PATH:/home/grid/storm-yarn-master/storm-0.9.0-wip21/bin:/home/grid/storm-yarn-master/bin [grid@hadoop4 storm-yarn-master]$ source ~/.bash_profile
9. 修改 storm-yarn-master/storm-0.9.0-wip21/conf/storm.yaml 配置文件,增加zookeeper的配置
## zookeeper集群的安裝與啟動,在介紹Storm集群安裝(
http://my.oschina.net/zc741520/blog/399233)時(shí)已經(jīng)有過詳細(xì)說明,這里就不再贅述
[grid@hadoop4 storm-yarn-master]$ vim storm-0.9.0-wip21/conf/storm.yaml storm.zookeeper.servers: - "hadoop4" - "hadoop5" - "hadoop6" master.initial-num-supervisors: 1 master.container.size-mb: 1024
10. 啟動 storm on yarn 環(huán)境
[grid@hadoop4 storm-yarn-master]$ storm-yarn launch storm-0.9.0-wip21/conf/storm.yaml
因?yàn)閟torm是作為一個(gè)yarn程序運(yùn)行在集群上的,所以在YARN的集群管理頁面中會有一個(gè)AppId
PS:第一次啟動時(shí)失敗了,最終發(fā)現(xiàn)是內(nèi)存不足導(dǎo)致的,解決辦法是在yarn-site.xml中設(shè)置yarn.nodemanager.vmem-check-enabled的值為false
11. 查找nimbus節(jié)點(diǎn)
[grid@hadoop4 storm-yarn-master]$ storm-yarn getStormConfig -appId application_1432484548277_0001 -output ~/.storm/storm.yaml [grid@hadoop4 storm-yarn-master]$ cat ~/.storm/storm.yaml | grep nimbus.host nimbus.host: 192.168.0.107
12. 提交Topology,這里用Storm自帶的WordCount例子程序
[grid@hadoop4 storm-yarn-master]$ storm jar lib/storm-starter-0.0.1-SNAPSHOT.jar storm.starter.WordCountTopology WordCountTopology -c nimbus.host=192.168.0.107
13. 查看storm的UI監(jiān)控界面(nimbus.host:7070)
“Storm On Yarn的安裝和部署”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。