ElasticSearch 5.6 cannot start on Mac OS
Asked Answered
B

3

9

I can't start ElasticSearch 5.6 server on Mac after installing it with Brew. Get this error:

$ /usr/local/opt/[email protected]/bin/elasticsearch
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: org.apache.lucene.index.IndexFormatTooNewException: Format version is not supported (resource BufferedChecksumIndexInput(SimpleFSIndexInput(path="/usr/local/etc/elasticsearch/elasticsearch.keystore"))): 3 (needs to be between 1 and 2)
Likely root cause: org.apache.lucene.index.IndexFormatTooNewException: Format version is not supported (resource BufferedChecksumIndexInput(SimpleFSIndexInput(path="/usr/local/etc/elasticsearch/elasticsearch.keystore"))): 3 (needs to be between 1 and 2)
    at org.apache.lucene.codecs.CodecUtil.checkHeaderNoMagic(CodecUtil.java:216)
    at org.apache.lucene.codecs.CodecUtil.checkHeader(CodecUtil.java:198)
    at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:175)
    at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:246)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:304)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123)
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
    at org.elasticsearch.cli.Command.main(Command.java:90)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)
Refer to the log for complete error details.

Since it's not the latest version of ElasticSearch, I suppose it has some incompatible package versions installed, though not sure what package exactly.

Can anyone help to get it working?

Bander answered 12/3, 2019 at 13:10 Comment(2)
I'm not sure with brew installation. Can you try downloading the package artifacts.elastic.co/downloads/elasticsearch/… and start? I'm maintaining multiple versions in my mac this way.Eskridge
Hey Arun, thank you for this tip! Yeah, this way it works. It's not something I was looking for but kinda workaround for my problem, thanks!Bander
D
16

I just had the same issue, and regenerating the keystore fixed the problem for me. Here are the steps I took:

Backup the existing keystore:

cd /usr/local/etc/elasticsearch/
mv elasticsearch.keystore elasticsearch.keystore.old

Generate the new keystore:

cd /usr/local/Cellar/[email protected]/5.6.15/libexec/bin/
elasticsearch-keystore create
Decency answered 27/4, 2019 at 23:10 Comment(2)
Thank you a lot! Finally, after doing your instructions I was able to start the ElasticSearch server :)Bander
On windows, I just moved logs, config and data folders( from C:/ProgramData/Elastic/ElasticSearch) to a new folder(dummy) and reinstalled the es and it worked for me.Hour
G
4

The server is most probably attempting to read a newer index (org.apache.lucene.index.IndexFormatTooNewException).

Most probably the only way is to get rid of it completely with:

sudo rm -rf  /usr/local/var/lib/elasticsearch

Please double check the index and make sure you don't need the old 6.* index anymore, because you're obviously going to lose it.

Gallon answered 18/3, 2019 at 16:33 Comment(1)
Unfortunately, it didn't help. Removed /usr/local/var/lib/elasticsearch completely but still have the same error when trying to start ES 5.6. I even tried to re-install it with Brew and it didn't help as well :/Bander
L
3

The provided answer is correct, however I would just like to add that you can just (re)start elasticsearch after removing the keyfile. It will detect that the file is absent and attempt to generate a new .keystore file automatically. No need to run the elasticsearch-keystore create command seperately.

Lowercase answered 21/10, 2019 at 12:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.