Skip to content

Instantly share code, notes, and snippets.

@wedataintelligence
Forked from grantm/start-es.sh
Created December 26, 2020 23:53
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 wedataintelligence/8c9e0a994f23f6bf70654bcd6398795a to your computer and use it in GitHub Desktop.
Save wedataintelligence/8c9e0a994f23f6bf70654bcd6398795a 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
@wedataintelligence
Copy link
Author

Access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment