Forked from emaxerrno/Installing zookeper and monitoring it
Last active
December 24, 2015 10:43
-
-
Save micrypt/1347e64fb816ebb6ac9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "assumes java 7 is installed (OpenJDK version)" | |
#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