Created
March 22, 2010 18:47
-
-
Save spidaman/340376 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 | |
### 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