Skip to content

Instantly share code, notes, and snippets.

@spikeekips
Last active Aug 29, 2015
Embed
What would you like to do?
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