Skip to content

Instantly share code, notes, and snippets.

@drewr
Created December 1, 2012 02:18
Show Gist options
  • Save drewr/4180222 to your computer and use it in GitHub Desktop.
Save drewr/4180222 to your computer and use it in GitHub Desktop.
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn limit 10 5
env ES_HOME=/opt/es/es
env DATA_DIR=/opt/es/data
env MEMMIN=512m
env MEMMAX=1g
console log
script
if [ -f /etc/default/elasticsearch ]; then
. /etc/default/elasticsearch
fi
# memlock
ulimit -l unlimited
# nofiles
ulimit -n 64000
cd $ES_HOME
exec setuidgid nobody \
env ES_MIN_MEM=$MEMMIN \
ES_MAX_MEM=$MEMMAX \
bin/elasticsearch -f \
-Des.path.data=$DATA_DIR
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment