Skip to content

Instantly share code, notes, and snippets.

@spikeekips
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikeekips/9266548 to your computer and use it in GitHub Desktop.
Save spikeekips/9266548 to your computer and use it in GitHub Desktop.
simple `etcd` cluster launch script for latest linux.
#!/bin/sh
n=$1
args=$(echo $@ | sed -e "s/^$1//g")
ip=$(ip addr show eth0 | grep '\<inet\>' | awk '{print $2}' | sed -s 's/\/.*//g')
./etcd \
-bind-addr=0.0.0.0 \
-peer-bind-addr=0.0.0.0 \
-addr $ip:$(expr 4000 + $n) \
-peer-addr $ip:$(expr 7000 + $n) \
-data-dir machines/machine$n \
-name machine$n \
-max-cluster-size 21 \
$args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment