-
Notifications
You must be signed in to change notification settings - Fork 0
Single node installation
This installation was done in Ubuntu 12.04
Download Zookeeper. Untar it and install it in a known path of you machine. Before running it, there's some basic configuration that that has to be done: To configure Zookeeper server create configuration file named ‘zoo.cfg’ in the ‘conf’ folder of untar Zookeeper setup.
Write following into the ‘conf.cfg’ file.
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
Change the value of dataDir to specify an existing (empty to start with) directory. Here are the meanings for each of the fields:`
tickTime
the basic time unit in milliseconds used by Zookeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime.
dataDir
the location to store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.
clientPort
the port to listen for client connections`
You will start Zookeeper when all the dependencies and Storm will be installed.
Alternatively you can install Zookeper simply with apt-get; however, it's very unlikely that you'll get the latest version
- sudo apt-get install Zookeeper
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update && sudo apt-get install oracle-jdk7-installer
- update-alternatives –display java
- java -version
- wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
- tar –xzf zeromq-2.1.7.tar.gz
- cd zeromq-2.1.7
- ./configure
- Make
- sudo make install
it can happen that you need uuid-deb packet, if so install it with:
- sudo apt-get install uuid-dev
Obtain JZMQ using
- git clone https://github.com/nathanmarz/jzmq.git
- cd jzmq
- ./autogen.sh
- export JAVA_HOME=/usr/lib/jvm/java-7-oracle
- ./configure
- make
- sudo make install
You may happen to need some packet dependencies; some possible packets are below
- sudo apt-get install libtool
- sudo apt-get install automake autoconf
There's some error detected in Ubuntu 12.04 when trying to compile the JZMQ, here is the solution to fix it: inside the src directory do
- CLASSPATH=.:./.:$CLASSPATH javac -d . org/zeromq/ZMQ.java org/zeromq/ZMQException.java org/zeromq/ZMQQueue.java org/zeromq/ZMQForwarder.java org/zeromq/ZMQStreamer.java then go one directory above and proceed with the compilation
In Ubuntu 12.10 there was encountered another error.
Making all in src
make[1]: Entering directory /home/user/jzmq/src' make[1]: *** No rule to make target
classdist_noinst.stamp', needed by org/zeromq/ZMQ.class'. Stop. make[1]: Leaving directory
/home/user/jzmq/src'
make: *** [all-recursive] Error 1
To solve it make
- touch src/classdist_noinst.stamp
Storm 0.8.1 was used in this tutorial
- Download Storm in your machine; in this installation Nimbus and Worker machines will be in the same physical machine and without virtualization.
- extract the zip in the folder you want, no installation is needed.
- Write following into the ‘storm.yaml’ file. (ensure the storm.local.dir has right permissions).
storm.zookeeper.servers:
- "localhost"
storm.zookeeper.port: 2181
nimbus.host: "localhost"
storm.local.dir: "/home/user/stormtmp"
java.library.path: "/usr/lib/jvm/java-7-oracle/lib"
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
worker.childopts: "-Xmx768m"
nimbus.childopts: "-Xmx512m"
supervisor.childopts: "-Xmx256m"
- Change the value of storm.local.dir to specify an existing (empty to start with) directory.
- Also copy this modified ‘storm.yaml’ file to “~/.storm/storm.yaml” folder. This is very important so do not forget to create ‘.storm’ folder in user root folder and copy the modified ‘storm.yaml’ file from ‘conf’ folder to created ‘.storm’ folder.
- Start Zookeeper by going to its bin directory and executing this command
sh zkServer.sh start
if you installed Zookeeper using apt-get install, bin directory should be located in /usr/share/zookepper/bin
- Now start Storm Nimbus and supervisor deamon processes, they are in Storm bin directory
storm nimbus
storm supervisor
- Run the Storm UI (a site you can access from the browser that gives diagnostics on the cluster and topologies) under supervision. The UI can be accessed by navigating your web browser to http://{nimbus host}:8080.
storm ui
If you have some problems when running the daemons check out the logs in the logs directory. Nimbus and supervisor have their own logs. Usually errors in initialization can be due to some syntax error in the configuration file.