Sudo service elasticsearch start is not working


(Navaneeth K N) #1

I am trying to start elasticsearch using the default init script provided.

sudo service elasticsearch start

This will say starting elasticsearch, but does nothing. Not sure what is going wrong. So I added some log statements to the /etc/init.d/elasticsearch. This is what it printed.

sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d 
    -p /var/run/elasticsearch/elasticsearch.pid 
   --default.config=/etc/elasticsearch/elasticsearch.yml 
   --default.path.home=/usr/share/elasticsearch 
   --default.path.logs=/var/log/elasticsearch 
   --default.path.data=/var/lib/elasticsearch 
   --default.path.work=/tmp/elasticsearch 
   --default.path.conf=/etc/elasticsearch

When I run the above command directly, it works. But it won't work when executed via sudo service elasticsearch start. Not sure why is this failing. Because of this, none of the default settings from /etc/default/elasticsearch got picked up.

Any help would be great to fix this issue. Following shows the elasticsearch version.

"version" : {
    "number" : "1.7.1",
    "build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
    "build_timestamp" : "2015-07-29T09:54:16Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },

(Magnus B├Ąck) #2

Anything interesting in the Elasticsearch log file? What if you attempt to start it with sudo sh -x /etc/init.d/elasticsearch start?


(system) #3