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

本文详细介绍了如何使用STORM和Twitter4j构建本地集群的步骤,包括下载相关组件、配置Eclipse环境、整合依赖库及运行示例拓扑。对于初学者来说,提供了一个清晰的指南,帮助解决遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


权限问题?


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值