一、Storm集群安裝部署
網上關於storm集群部署都大同小異。
Storm下載地址:http://storm-project.net Storm項目地址:https://github.com/nathanmarz/storm
目前的版本不支持ZooKeeper3.4.5版本,而支持ZooKeeper3.3.3版本。
我當時沒注意這個問題,部署一直不成功,又不想換zk版本,索性自己編譯支持zk3.4.5的源碼。
暫且不表編譯源碼的事,先說說Storm集群安裝部署的步驟。
我主要參考的是這篇文章:http://www.cnblogs.com/panfeng412/archive/2012/11/30/how-to-install-and-deploy-storm-cluster.html
我用的是CentOS,在安裝Storm依賴庫的時候可能會遇到一些問題,大家根據錯誤提示安裝依賴。
附帶其他參考文章:
1、http://www.fuzhijie.me/?p=780
2、http://www.cnblogs.com/kemaswill/archive/2012/10/24/2737833.html
注意:Storm是依賴zk通信的,請先確保zk集群運行正常。zk啟動失敗有一點大家可能會忽視:防火牆沒有關掉!!!
CentOS關閉防火牆的方法:/etc/init.d/iptables stop 永久關閉防火牆:chkconfig --level 35 iptables off
zk集群的安裝部署:http://blog.chinaunix.net/uid-20498361-id-3184380.html
二、編譯Storm源碼
該支持zk345版本的源碼:https://github.com/nathanmarz/storm/tree/0.9.0-zk345b
主要參考這篇文章:http://www.mbazhan.com/a/92.html
Storm 源碼編譯需要leiningen,而leiningen又依賴Maven,所以leiningen和Maven都需要安裝好。
leiningen的安裝:http://blog.csdn.net/sheismylife/article/details/8434148
注意:要將lein和mvn加到Path中
編譯Storm源碼為發行版,只需運行源碼目錄bin文件下的build_release.sh
在編譯過程中我老是遇到這個錯誤:編譯到back.type.storm.test4j報找不到back.type.storm.LocalCuster。
我解決的方法是:1、將storm-0.8.2.jar下back.type.storm.LocalCuster的所有相關的class文件copy到target文件夾下back.type.storm包下
2、然后用vi打開build_release.sh,注釋掉$LEIN with-profile release clean
三、編譯運行storm-starter
參考:
1、http://blog.csdn.net/guoqiangma/article/details/7212677
2、http://redwhiteblack.lofter.com/post/c00d6_39934a
storm-starter maven依賴包缺少twitter4j依賴包的解決方法:http://blog.sina.com.cn/s/blog_5ca749810101cepq.html
storm創建新項目:http://www.coderzhang.com/blog/storm%E5%88%9B%E5%BB%BA%E6%96%B0%E9%A1%B9%E7%9B%AE/
Q:Kill topology storm kill ${stormname} 報NotAliveException
看了Storm UI 顯示Topology 是Active的,Topology的名字也沒錯,不知為何?!
有知道的同學麻煩說一下。