Skip to content

Instantly share code, notes, and snippets.

@we4tech
Forked from rbscott/elasticsearch.conf
Last active August 29, 2015 13:58
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 we4tech/9931091 to your computer and use it in GitHub Desktop.
Save we4tech/9931091 to your computer and use it in GitHub Desktop.
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