Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch 5.6 cannot start on Mac OS

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?

like image 693
Victor Bocharsky Avatar asked Mar 12 '19 13:03

Victor Bocharsky


People also ask

How do I downgrade Elasticsearch on Mac?

No, Elasticsearch does not support downgrades. You need to make sure you have a snapshot taken using the snapshot API that you can restore if you want to go back to the older version.

How do I completely remove Elasticsearch from my Mac?

1)Run the cd /usr/lib/netbrain/installer/elasticsearch command to navigate to the elasticsearch directory. 2)Run the ./uninstall.sh command under the elasticsearch directory. 3)Specify whether to remove all Elasticsearch data.


2 Answers

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
like image 84
geoff Avatar answered Sep 28 '22 11:09

geoff


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.

like image 30
ngw Avatar answered Sep 28 '22 12:09

ngw