Elastic search won't start after fresh install on Debian

$ uname -a
3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux

I installed Java like to /opt/jdk/jdk1.8.0_91

Then installed elastic:
Imported key
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Added repo
echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list

Installed
apt-get install elasticsearch

config:
All I changed in the config was to edit /etc/elasticsearch/elasticsearch.yml and specify:
network.host localhost

Then
sudo /bin/systemctl daemon-reload
sudo systemctl start elasticsearch

This is what I see:

sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled)
   Active: failed (Result: exit-code) since Sat 2016-06-11 23:05:19 EDT; 3s ago
     Docs: http://www.elastic.co
  Process: 5526 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID_DIR}/elasticsearch.pid -Des.default.path.home=${ES_HOME} -Des.default.path.logs=${LOG_DIR} -Des.default.path.data=${DATA_DIR} -Des.default.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
  Process: 5523 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 5526 (code=exited, status=1/FAILURE)

Jun 11 23:05:19 Rick elasticsearch[5526]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
Jun 11 23:05:19 Rick elasticsearch[5526]: at <<<guice>>>
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.node.Node.<init>(Node.java:213)
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.node.Node.<init>(Node.java:140)
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
Jun 11 23:05:19 Rick elasticsearch[5526]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Jun 11 23:05:19 Rick systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 11 23:05:19 Rick systemd[1]: Unit elasticsearch.service entered failed state.

No logs in /var/logs/elasticsearch

Running the program directly I see this:

sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d -p /var/run/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

[2016-06-11 23:09:00,329][INFO ][bootstrap ] es.default.config is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed.

This is a fresh install of the latest elasticsearch. I never configured es.default.config nor can I find it or links to it in any elastic dirs.

Hi, I got this error too when I updated my Elasticsearch, apparently it was several causes, one of which was that the elasticsearch user couldn't write to a certain directory (if you google your error you'll end up on some blog where a simple solution is explained, I can't really recall which I'm afraid). Further more, probably not useful in your usecase, but the plug-in I installed was installed for 2.3.2, after my update it went to 2.3.3...which failed my ES from booting without any error message.

Hmm I wasn't able to find anything about this being due to a permissions error.

Also, this isn't an upgrade this is a completely fresh install.

OK your right this was mostly a simple permissions issue.

The elastic user had access to /var/lib/elasticsearch/ and /var/log/elasticsearch/ but for some reason didn't have access to /etc/elasticsearch

After fixing that I got this error in the elastic log:
[2016-06-12 12:02:09,464][ERROR][bootstrap ] Guice Exception: java.lang.IllegalArgumentException: script.disable_dynamic is not a supported setting, replace with fine-grained script settings.
Dynamic scripts can be enabled for all languages and all operations by replacing script.disable_dynamic: false with script.inline: on and script.indexed: on in elasticsearch.yml

So doing exactly what the error suggests (replacing script.disable_dynamic: false with script.inline: on and script.indexed: on in elasticsearch.yml) solved my issues.

1 Like

Still a weird error isn't it? I find the errors that ES gives very unhelpful, if it gives any error at all.

1 Like