Reputation: 12306
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?
Upvotes: 9
Views: 6466
Reputation: 51
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.
Upvotes: 3
Reputation: 456
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
Upvotes: 16
Reputation: 1282
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.
Upvotes: 4