After some time, I gave up, removed the elasticsearch repo installation, and instead downloaded the zip file. Then I created two upstarts and everything still works.
description "Start several ES-instances at once (this is a wrapper)." start on (local-filesystems and net-device-up IFACE!=lo) stop on runlevel [06] respawn # Give up respawn if restart occurs 5 times in 120 seconds respawn limit 5 120 env NUM_INSTANCES=4 pre-start script for i in $(seq 1 $NUM_INSTANCES) do start elasticsearch-instance ID=$i done end script pre-stop script curl -XPOST "http://localhost:9200/_cluster/nodes/_local/_shutdown" end script
- Instances
description "starts up an elasticsearch instance (node)" stop on stopping elasticsearch respawn instance $ID limit nofile 64000 64000 setuid elasticsearch setgid elasticsearch env JAVA_OPTS="-XX:+UseCompressedOops" env ES_HEAP_SIZE=28G exec /data/elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch/config/elasticsearch.yml
source share