Created
April 20, 2014 04:15
-
-
Save ksato9700/11104810 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/bash | |
index=$1 | |
HOST=127.0.0.1 | |
PR_PORT=$(expr 7000 + $index) | |
MY_PORT=$(expr 4000 + $index) | |
if [ $index -gt 1 ] | |
then | |
PEERS="-peers " | |
for i in $(seq 2 $index) | |
do | |
PEERS="$PEERS $HOST:$(expr $PR_PORT - $i + 1)" | |
done | |
fi | |
MACHINE_NAME=machine$index | |
./bin/etcd \ | |
-peer-addr $HOST:$PR_PORT \ | |
-addr $HOST:$MY_PORT \ | |
-data-dir machines/$MACHINE_NAME\ | |
-name $MACHINE_NAME \ | |
$PEERS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment