Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ElasticSearch upstart script
# ElasticSearch Service
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
respawn limit 10 30
# NB: Upstart scripts do not respect
# /etc/security/limits.conf, so the open-file limits
# settings need to be applied here.
limit nofile 32000 32000
console output
script
if [ -f /etc/default/elasticsearch ]; then
. /etc/default/elasticsearch
fi
export ES_HOME=/opt/elasticsearch-1.1.0
export ES_MIN_MEM=256m
export ES_MAX_MEM=2g
DAEMON="${ES_HOME}/bin/elasticsearch"
DATA_DIR="/lucene-index"
CONFIG_DIR="${ES_HOME}/config"
LOG_DIR="/var/log/elasticsearch"
sudo -E -u ubuntu $DAEMON -Des.path.conf=$CONFIG_DIR -Des.path.home=$ES_HOME -Des.path.logs=$LOG_DIR -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
You can’t perform that action at this time.