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?
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With