Elasticsearch won't start after upgrade from 2.4.5 to 5.6

I am trying to upgrade Elasticsearch from 2.4.5 to 5.6 on the latest Debian. I did the upgrade, and after the upgrade, Elasticsearch would not start. I have no plugins installed, so that is not an issue. I kept my elasticsearch.yml and init script. I updated the data directory, so that is not an issue. The frustrating part is there is nothing in the /var/log/elasticsearch logs or /var/log/messages. The main problem seems to center around:

ERROR: D is not a recognized option

The full output when I do service elasticsearch status is:

root@myserver:~# service elasticsearch status
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled)
Active: failed (Result: exit-code) since Tue 2017-12-26 15:39:44 PST; 1min 21s ago
Docs: http://www.elastic.co
Process: 940 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=64)
Process: 821 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 940 (code=exited, status=64)

Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -V, --version Prints elasticsearch version information and exits
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -d, --daemonize Starts Elasticsearch in the background
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -h, --help show help
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -p, --pidfile Creates a pid file in the specified path on start
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -q, --quiet Turns off standard ouput/error streams logging in console
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -s, --silent show minimal output
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: -v, --verbose show verbose output
Dec 26 15:39:43 dshsapoly808glp elasticsearch[940]: ERROR: D is not a recognized option
Dec 26 15:39:44 dshsapoly808glp systemd[1]: elasticsearch.service: main process exited, code=exited, status=64/n/a
Dec 26 15:39:44 dshsapoly808glp systemd[1]: Unit elasticsearch.service entered failed state.

Any help would be appreciated.

Whats your java version?

We are now using -E instead of -D.

Sounds like startup scripts have not been updated.

Here is my Java info:

openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

OK, I see it is out of date. I will upgrade it. Would this be the problem?

Hi, forgive my stupidity, but where is the -E versus -D? In the init script, elasticsearch.yml, or /etc/default/elasticsearch?

I can see that in your logs:

Process: 940 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=64)

You can see there a lot of -D.

See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/breaking_50_settings_changes.html#_using_system_properties_to_configure_elasticsearch

I upgraded my Java to the latest, and ran the upgrade again. I accepted the new init script, but kept my old elasticsearch.yml file. It now works. Thank you everyone.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.