Skip to content

Instantly share code, notes, and snippets.

@dungvn3000
Forked from emaxerrno/Installing zookeper and monitoring it
Last active December 22, 2015 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dungvn3000/6411058 to your computer and use it in GitHub Desktop.
Save dungvn3000/6411058 to your computer and use it in GitHub Desktop.
For storm cluster install
#!/bin/sh
echo "assumes java 7 is instlaled openjdk versio"
#pre dependencies
sudo apt-get install git-core pkg-config libtool automake make g++ connect-proxy unzip python
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
#install zeromq
git clone git clone git://github.com/zeromq/libzmq.git
pushd libzmq
./autogen.sh
./configure # add other options here
make
make check
sudo make install
sudo ldconfig
popd
#install the java bindings
git clone http://github.com/zeromq/jzmq
pushd jzmq
./autogen.sh
./configure
make
sudo make install
popd
#now install zookeeper
sudo apt-get install zookeeper #installs 3.3.5
export PATH=/usr/share/zookeeper/bin:$PATH
echo "Don't forget to modify /etc/zookeper/conf/myid"
echo "Don't forget to add /usr/share/zookeeper/bin to your PATH var permanently"
# needs this for zookpr as that is a failfast deamon :(
# supervisord is a deamon that watches your processes and restarts them if needed
sudo apt-get install supervisor python-pip python-dev
sudo pip install python-handler-socket
#add at the end of
sudo cat >> /etc/supervisor/supervisord.conf <<DELIMITER
[program:zookeeper]
command=/usr/share/zookeeper/bin/zkServer.sh start-foreground
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=KILL
DELIMITER
tail -f /var/log/supervisor/supervisord.log &
sudo /etc/init.d/supervisor start
echo "If you got this far without errors, you owe alex a beer."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment