Easy Steps to Create Storm Project ( Twitter Support) in Eclipse

1. Download STORM Release: 

(https://github.com/nathanmarz/STORM/downloads)  

2. Download Twitter4j 2.2.5+ 

(http://twitter4j.org/en/index.html

3. Create a New "Java Project" in Eclipse 

4. Include all jars from STORM (as Project Libraries -> External Jars) STOMR-0.5.3.jar lib/* (Every Jar in the /lib directory) 

5. Include two jars from Twitter4j  (as Project Libraries -> External Jars) 

twitter4j-core-2.2.5 
twitter4j-stream 

6. Now to run locally, you'll need to create a Topology with a main method that submits it to a LocalCluster. For good examples, check out the storm-starter project. The easiest for me to see was the PrintSampleStream.java topology but a lot of people seem to prefer ExclamationTopology.java. 

Note that if you use the PrintSampleStream, you'll need to modify TwitterSampleSpout.java to print the status in the onStatus method. 
For example, you can include this before the "queue.offer(...)" call: 

System.out.println(status.getUser().getName() + " : " + status.getText()); 

This is probably beginner stuff to a lot of you, but I had a lot of trouble getting these steps down. Hopefully it will help someone else. 
Thanks to Nathan Marz for all of the wonderful support!


使用 storm-starter maven 建立依賴,STORM包會有,4不執行。Twitter4j一般是被牆了。下載後執行5.

執行程序。報錯

ERROR org.apache.zookeeper.server.NIOServerCnxn  - Thread Thread[main,5,main] died
java.io.IOException: 

Unable to delete file: C:\DOCUME~1\××××\LOCALS~1\Temp\cfc5313d-a0bd-42a6-9738-4b97d55958da\version-2\log.1


權限問題?


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章