Created
September 22, 2012 23:16
-
-
Save vincentmac/3768181 to your computer and use it in GitHub Desktop.
sh:riak dev cluster start|stop
This file contains hidden or 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 | |
# Vincent Mac | |
# Simple start/stop script for launching Riak Cluster for local development or fast track | |
# After building your dev environment using `make devrel`, place this script in the `dev` folder | |
# Identify the script name | |
SCRIPT=`basename $0` | |
case "$1" in | |
start) | |
# Check ulimit on system and set to 1024 if currently less | |
ULIMIT_F=`ulimit -n` | |
if [ "$ULIMIT_F" -lt 1024 ]; then | |
echo "!!!!" | |
echo "!!!! WARNING: ulimit -n is ${ULIMIT_F}; 1024 is the recommended minimum." | |
echo "!!!!\n" | |
echo "...now setting ulimit to 1024" | |
ulimit -n 1024 | |
fi | |
for i in {1..4} | |
do | |
echo "Starting riak node dev$i..." | |
dev$i/bin/riak start | |
done | |
;; | |
stop) | |
for i in {4..1} | |
do | |
echo "Stoping riak node dev$i..." | |
dev$i/bin/riak stop | |
done | |
;; | |
*) | |
echo "Usage: $SCRIPT {start|stop}" | |
exit 1 | |
;; | |
esac | |
# dev1/bin/riak start | |
# dev2/bin/riak start | |
# dev3/bin/riak start | |
# dev4/bin/riak start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment