Skip to content

Instantly share code, notes, and snippets.

@solar
Created October 16, 2012 09:56
Show Gist options
  • Select an option

  • Save solar/3898427 to your computer and use it in GitHub Desktop.

Select an option

Save solar/3898427 to your computer and use it in GitHub Desktop.
install zookeeper with supervisord
curl -L http://ftp.kddilabs.jp/infosystems/apache/zookeeper/zookeeper-3.4.4/zookeeper-3.4.4.tar.gz | tar zx
sudo mkdir /usr/local/zookeeper
sudo cp zookeeper-3.4.4 /usr/local/zookeeper/3.4.4
sudo cp ./zookeeper.sh /usr/local/zookeeper/
sudo cp ./zoo.cfg /usr/local/zookeeper/
sudo cp ./zookeeper.ini /etc/supervisord.d/
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/var/zookeeper
# the port at which the clients will connect
clientPort=2181
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
[program:zookeeper]
command=/usr/local/zookeeper/zookeeper.sh
autostart=true
autorestart=true
user=root
#!/bin/sh
JAVA=/usr/bin/java
CONF=/usr/local/zookeeper/zoo.cfg
exec $JAVA \
-cp "/usr/local/zookeeper/3.4.4/bin/../build/classes:/usr/local/zookeeper/3.4.4/bin/../build/lib/*.jar:/usr/local/zookeeper/3.4.4/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper/3.4.4/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper/3.4.4/bin/../lib/netty-3.2.2.Final.jar:/usr/local/zookeeper/3.4.4/bin/../lib/log4j-1.2.15.jar:/usr/local/zookeeper/3.4.4/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper/3.4.4/bin/../zookeeper-3.4.4.jar:/usr/local/zookeeper/3.4.4/bin/../src/java/lib/*.jar:/usr/local/zookeeper/3.4.4/bin/../conf:" \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.local.only=false \
org.apache.zookeeper.server.quorum.QuorumPeerMain \
"$CONF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment