`

Storm: compile storm source code and run storm-starter

 
阅读更多

https://github.com/apache/storm/tree/master/examples/storm-starter

 

1 down load the source codes

# git clone git://github.com/apache/storm.git

2 Build and install Storm jars locally

mvn clean package install -DskipTests=true

 

3 Running topologies with Maven

#cd examples/storm-starter

# mvn compile exec:java -Dstorm.topology=storm.starter.clj.word_count

 

4.Build a distribution

#cd storm-dist/binary && mvn package

 

ingore the errors    gpg: signing failed: secret key not available

 

5.Install distribution

#cp storm-dist/binary/target/apache-storm-0.10.0-SNAPSHOT.tar.gz     /path/to/install/dir

#cd /path/to/install/dir

#tar xvf apache-storm-0.10.0-SNAPSHOT.tar.gz

 

configure ~/.bashrc

export STORM_HOME=/path/to/install/dir/apache-storm-0.10.0-SNAPSHOT

export PATH :=$STORM_HOME/bin

 

#source ~/.bashrc

 

6.Test

#cd /path/to/install/dir/apache-storm-0.10.0-SNAPSHOT/examples/storm-starter

#storm jar storm-starter-topologies-0.10.0-SNAPSHOT.jar storm.starter.RollingTopWords

 

------------------------------------

Set up a custom storm project in Eclipse

When I use maven import storm project to eclipse, there are some errors that couldn't cope with till now.

So, the other way is to build a new java project.

1. build a new java project in eclipse.

2. import storm-start source codes to srm dir from apache-storm-0.9.3/examples/storm-starter/src/jvm

3. import apache-storm-0.9.3/examples/storm-starter/multilang to project as a source fold .

The result dir tree is



 

4. configure build path

right click project name -> Build Path -> Configure Build Path -> Add variables -> New ->  create a  variable storm-0.9.3-lib  and Add External Jars in  apache-storm-0.9.3/lib to this variable. 

Note: org.twitter4j  commons-collections  com.google.guava  related jars should also put to storm-0.9.3-lib variable, theos jars could be found in your local maven repsotory. Which version sould be imported, please refer to  pom.xml in storm dir and storm-start dir.

 

 

5. test

run  WordCountTopology  in eclipse.

 

 

-------------------------------

setup a storm cluster

see: https://storm.apache.org/documentation/Setting-up-a-Storm-cluster.html

 

 

 

 

 

Prefences

https://github.com/mbonaci/mbo-storm/wiki/Storm-setup-in-Eclipse-with-Maven,-Git-and-GitHub

http://storm.apache.org/documentation/Creating-a-new-Storm-project.html

http://hantec.iteye.com/blog/1783754

  • 大小: 15.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics