Skip to content

Instantly share code, notes, and snippets.

@spidaman
Created March 22, 2010 18:47
Show Gist options
  • Save spidaman/340376 to your computer and use it in GitHub Desktop.
Save spidaman/340376 to your computer and use it in GitHub Desktop.
#/bin/sh
### What:
# Download and untar the zookeeper distribution and run this to
# create a replicated zookeeper on localhost
## How:
# Create a directory to run servers in
# Copy the zookeeper distribution into it 3x
###
mkdir -p ~/servers
for i in 1 2 3
do
cp -rp ~/Downloads/zookeeper-3.2.2 ~/servers/zk-3.2.2-$i
cat <<EOF > ~/servers/zk-3.2.2-$i/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=$HOME/servers/zk-3.2.2-$i/data
clientPort=218$i
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
EOF
mkdir -p ~/servers/zk-3.2.2-$i/data
echo $i > ~/servers/zk-3.2.2-$i/data/myid
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment