public
Created

Launch ES with ulimit raise for more filehandles

  • Download Gist
start-es.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.