Created
August 1, 2012 21:31
-
-
Save grantm/3230962 to your computer and use it in GitHub Desktop.
Launch ES with ulimit raise for more filehandles
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 | |
ES_BINARY=/home/grant/elasticsearch-0.18.7/bin/elasticsearch | |
if [ -z "$1" ] | |
then | |
sudo $0 as-root $USER | |
stty sane | |
elif [ "$1" = "as-root" ] | |
then | |
ORIGINAL_USER=$2 | |
echo "Increasing ulimit" | |
ulimit -n 4096 | |
su -c "$0 start-es" $ORIGINAL_USER | |
elif [ "$1" = "start-es" ] | |
then | |
echo "Starting ES" | |
$ES_BINARY & | |
sleep 5 | |
else | |
echo "Unknown argument: '$1'" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment