-
-
Save we4tech/9931091 to your computer and use it in GitHub Desktop.
ElasticSearch upstart script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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