Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@grantm
Created August 1, 2012 21:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grantm/3230962 to your computer and use it in GitHub Desktop.
Save grantm/3230962 to your computer and use it in GitHub Desktop.
Launch ES with ulimit raise for more filehandles
#!/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