Apache Storm installation
Now, let’s see how to install the Apache Storm framework on your machine. Here are three steps -
- Install Java on your system if you don't have it installed already.
- Install the ZooKeeper framework.
- Install the Apache Storm framework.
Step 1 - Verify Java Installation
Use the following command to check if Java is installed on your system.
$ java -version
If Java already exists, then you will see its version number. Otherwise, download the latest version of the JDK.
Step 1.1 - Download JDK
Use the following link- www.oracle.com to download the latest version of JDK
The latest version is JDK 8u 60 and the file is " jdk-8u60-linux-x64.tar.gz”. Download the file on your machine.
Step 1.2 - Unzip the file
Usually the file is downloaded to the Downloads folder. Use the following command to unpack the tar setup.
$ cd /go/to/download/path $ tar -zxf jdk-8u60-linux-x64.gz
Step 1.3 - Move to opt folder
To make Java available to all users, move the extracted Java content to the "/usr/local/java" folder.
$ su password: (type password of root user) $ mkdir /opt/jdk $ mv jdk-1.8.0_60 /opt/jdk/
Step 1.4 - Set Path
To set the path and JAVA_HOME variable, add the following commands to the ~/.bashrc file.
export JAVA_HOME =/usr/jdk/jdk-1.8.0_60 export PATH=$PATH:$JAVA_HOME/bin
Now apply all changes to the currently running system.
$ source ~/.bashrc
Step 1.5 - Java Alternative
Use the following command to change the Java alternative.
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_60/bin/java 100
Step 1.6
Now verify the Java installation using the verify command (java -version) explained in step 1.
Step 2 - ZooKeeper Framework Installation
Step 2.1 - Download ZooKeeper
To install ZooKeeper Framework on your computer, please visit the following link and download the latest version of ZooKeeper http://zookeeper.apache.org/releases.html
So far, the latest version of ZooKeeper is 3.4.6 (ZooKeeper-3.4.6.tar.gz).
Step 2.2 - Unzip the tar file
Use the following command to unzip the tar file-
$ cd opt/ $ tar -zxf zookeeper-3.4.6.tar.gz $ cd zookeeper-3.4.6 $ mkdir data
Step 2.3 - Create the configuration file
Use the command " vi conf/zoo.cfg" Open the configuration file named "conf/zoo.cfg" and set all the following parameters as a starting point.
$ vi conf/zoo.cfg tickTime=2000 dataDir=/path/to/zookeeper/data clientPort=2181 initLimit=5 syncLimit=2
After the configuration file is successfully saved, you can start the ZooKeeper server.
Step 2.4 - Start the ZooKeeper server
Use the following command to start the ZooKeeper server.
$ bin/zkServer.sh start
After executing this command, you will receive a response as follows -
$ JMX enabled by default $ Using config: /Users/../zookeeper-3.4.6/bin/../conf/zoo.cfg $ Starting zookeeper ... STARTED
Step 2.5 - Start CLI
Use the following command to start the CLI.
$ bin/zkCli.sh
After executing the above command, you will connect to the ZooKeeper server and get the following response.
Connecting to localhost:2181 ................ ................ ................ Welcome to ZooKeeper! ................ ................ WATCHER:: WatchedEvent state:SyncConnected type: None path:null [zk: localhost:2181(CONNECTED) 0]
Step 2.6 - Stop the ZooKeeper Server
After connecting to the server and performing all operations, you can stop the ZooKeeper server using the following command.
bin/zkServer.sh stop
You have successfully installed Java and ZooKeeper on your computer. Now let us see the steps to install the Apache Storm framework.
Step 3 - Apache Storm Framework Installation
Step 3.1 - Download Storm
To install Storm Framework on your computer, please visit the following link and download the latest version of Storm http://storm.apache.org/downloads.html
The latest version of Storm so far is "apache-storm-0.9.5.tar.gz".
Step 3.2 - Unzip the tar file
Use the following command to unzip the tar file
$ cd opt/ $ tar -zxf apache-storm-0.9.5.tar.gz $ cd apache-storm-0.9.5 $ mkdir data
Step 3.3 - Open the configuration file
The current version of Storm is in "conf /storm.yaml" contains a file that configures the Storm daemon. Add the following information to the file.
$ vi conf/storm.yaml storm.zookeeper.servers: - "localhost" storm.local.dir: “/path/to/storm/data(any path)” nimbus.host: "localhost" supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703
After applying all changes, save and return to the terminal.
Step 3.4 - Start Nimbus
$ bin/storm nimbus
Step 3.5 - Start Supervisor
$ bin/storm supervisor
Step 3.6 - Start UI
$ bin/storm ui
After starting the Storm user interface application, Type the URL http://localhost:8080 into your favorite browser and you can see the Storm cluster information and the topology it is running on. The page should look similar to the screenshot below.