Pages

set up storm cluster(twitter storm) in local mode

Setup Storm Cluster In Local Mode 

Introduction

Storm is a free and open source distributed realtime computation system. 

1. INSTALLING STORM CLUSTER IN LOCAL MODE:

In this tutorial, I will tell you how to set up storm cluster in local mode(single machine). To set up and execute topology in local mode, we are going to use Maven. There is another way to set up storm in local mode, but I preferd maven.

Local mode simulates a Storm cluster in process and is useful for developing and testing topologies. Running topologies in local mode is similar to running topologies on a cluster.

2. SOFTWARE ENVIRONMENT :

Here the software platform which We used-

  •    Operating System: Ubuntu 12.04
  •    Java: Oracle/SUN , version:1.7.0_25
  •    Maven: Maven2
  •    Storm-0.8.2


3. Prerequisits:

  • Install latest version of JAVA(1.7.0_25) 
  • Set PATH Environment variable for java.
  • Set JAVA_HOME
note: click on this link to know how to install java on Ubuntu/Linux

http://www.techie-knowledge.co.in/2013/08/installing-java-on-linuxubuntu.html

4. How to Install Maven:

TO install Maven on ubuntu check the given link-


5. Check weather maven is installed or not using the command-

                  $ mvn -version

6. Install storm storm-0.8.2:

1. Download storm release (in my case storm-0.8.2) from the following link-

    https://github.com/nathanmarz/storm

2. Extract the downloaded storm release using the following command

$ tar -xvzf ~/Downloads/storm-0.8.2/ -C /usr/local

 

3. Set the path of bin directory of storm release to access the storm command from anywhere,
without typing the full path

Now your storm cluster is ready form local mode. Now can run a sample program to check it Where it is working or not.



7. Now  download the storm example from the given link-

    https://codeload.github.com/storm-book/examples-ch02-getting_started/legacy.zip/master
 
go to download zip button


8. Now go to the directory where you downloded the example and extract it, and change the directory to your project directory.

                $ cd ~/path-to-downloaded-directory/project-name


9. Now compile the project using maven. To compile project just type the following commnd on terminal prompt-

                $ mvn -e compile

After the "build successfull" go to next step.

10. Now type the following command on terminal to run the project to run

 mvn -e exec:java -Dexec.mainClass="TopologyMain" -Dexec.args="src/main/resources/words.txt"