I installed on my Mac OS 14.0.6 Elasticsearch with brew. It must be ES V 6 - not 7. But I tied to install 7 too - same error. So must be problem with the jdk? After installation was running well, I start with command elasticsearch and I get the following error in console:
JAVA VERSION: java -version java version "12.0.2" 2019-07-16 Java(TM) SE Runtime Environment (build 12.0.2+10) Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
2019-08-19 20:19:13,173 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,173 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,174 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,202 main ERROR Unable to locate plugin for ESJsonLayout
2019-08-19 20:19:13,219 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.NullPointerException java.lang.NullPointerException
at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.findNamedNode(PluginElementVisitor.java:103)
at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.visit(PluginElementVisitor.java:87)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.injectFields(PluginBuilder.java:181)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
2019-08-19 20:19:13,222 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
.......and on .... ```
I tried different reinstalls, but nothing works. Some help will be nice.
can you check /usr/local/etc/elasticsearch - is it possible, that you have mixed configuration files in there (some are suffixed with .default) from several versions? one possibility would be to remove your elasticsearch brew, then remove that config directory and install your desired version again or to sort those configurations out manually, in case you did any changes.
this looks to me as if there are still old files lingering around. Did you delete the whole folder or just some files? Can you run grep gc.log /usr/local/etc/elasticsearch -r and paste the output?
[2019-08-20T16:40:03,461][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]]; nested: IOException[failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]]; nested: XContentParseException[[-1:36] [node_meta_data] unknown field [node_version], parser not found];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.2.jar:6.8.2]
Caused by: org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]
at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:165) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:306) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more
Caused by: java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:300) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more
Caused by: org.elasticsearch.common.xcontent.XContentParseException: [-1:36] [node_meta_data] unknown field [node_version], parser not found
at org.elasticsearch.common.xcontent.ObjectParser.getParser(ObjectParser.java:369) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.common.xcontent.ObjectParser.parse(ObjectParser.java:158) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.common.xcontent.ObjectParser.apply(ObjectParser.java:182) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeMetaData$1.fromXContent(NodeMetaData.java:110) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeMetaData$1.fromXContent(NodeMetaData.java:94) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.read(MetaDataStateFormat.java:197) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more
is it possible, that you already ran another, newer or older version of elasticsearch on that system? Like 7.x or 2.x? If so, you might just delete your data directory in /usr/local/var/lib/elasticsearch/ (which might mean dataloss from previous runs) or configure another cluster name.
No. I did fresh installation on Mac. I also deleted the folder - or all folders - to try new installation. I get the error. I can not get it run.
Your code before was fixing the log problem. But the rest still there.
OK - I found the solution. I removed all Elasticsearch files - total cleanup. Than I shut down the MAMP PRO server and installed with brew fresh. Than I start my MAMP PRO server. All fine. Nothing to change or do. Looks like if there is the MAMP PRO Server running in the installation process, its creating incorrect path or files.
Its a local developing solution. It creates apache, mysql and on on your machine. https://www.mamp.info/en/mamp-pro/
I was reading in some stackoverflow questions about this. Guess the virtual server is the problem? I don't know...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.