Skip to content

Instantly share code, notes, and snippets.

@mattsta
Last active August 29, 2015 13:57
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 mattsta/9689072 to your computer and use it in GitHub Desktop.
Save mattsta/9689072 to your computer and use it in GitHub Desktop.
Redis Cluster Linux Bring-Up
# Launch 18 redis cluster instances on one machine using two IPs
cd redis/src
for dir in {1..9}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind 127.0.0.1 --cluster-enabled yes --port 700$dir & popd; done
IP=`/sbin/ifconfig eth0 |grep "inet addr" | tail -1 |awk '{printf $2}' |awk -F: '{printf $2}'`
for dir in {21..29}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind $IP --cluster-enabled yes --port 70$dir & popd; done
./redis-trib.rb create --replicas 1 127.0.0.1:{7001..7009} $IP:{7021..7029}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment