title: ElasticSearch 5.6 cannot start on Mac OS
body: <p>I can't start ElasticSearch 5.6 server on Mac after installing it with Brew. Get this error:</p>
  
  <pre><code>$ /usr/local/opt/elasticsearch@5.6/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.
  </code></pre>
  
  <p>Since it's not the latest version of ElasticSearch, I suppose it has some incompatible package versions installed, though not sure what package exactly.</p>
  
  <p>Can anyone help to get it working?</p>