1. 安装
获取storm-starter源代码
cd storm_starter
mvn package
使用 Intellij
- Open File > Import Project… and navigate to the storm-starter directory of your storm clone (e.g. ~/git/storm/examples/storm-starter).
- Select Import project from external model, select “Maven”, and click Next.
In the following screen, enable the checkbox Import Maven projects automatically. Leave all other values at their defaults. Click Next. - Click Next on the following screen about selecting Maven projects to import.
Select the JDK to be used by IDEA for storm-starter, then click Next.
At the time of this writing you should use JDK 6.
It is strongly recommended to use Sun/Oracle JDK 6 rather than OpenJDK 6. - You may now optionally change the name of the project in IDEA. The default name suggested by IDEA is “storm-starter”. Click Finish once you are done
可能出现的问题
- org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect.
解决方案:
http://blog.csdn.net/myemail_sl/article/details/11074017
设置执行参数。在Deault VM Arguments中设置-Djava.net.preferIPv4Stack=true - 如果出现缺少module.xml 那么需要重新导入一次项目即可。
- java.lang.NoClassDefFoundError: backtype/storm/topology/IRichSpout….
http://blog.jobbole.com/88203/ 这篇文章给出了解释。
解决方案:在pom.xml将storm的scope由provided修改为compile即可。