无法启动elasticsearch

时间:2018-02-19 05:35:00

标签: elasticsearch

我是计算机科学的新手,所以我需要一个非常准确的指导。我尝试重新安装几次。我试图在互联网上找到类似的问题,但我不明白他们在谈论什么,我也无法找到与我一样的问题,但它不起作用。请帮忙。我发生了很多错误!不知道该怎么做

2018-02-19 05:51:07,619 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.lo
gging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: N
o factory method found for class org.apache.logging.log4j.core.appender.RollingF
ileAppender
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findF
actoryMethod(PluginBuilder.java:229)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build
(PluginBuilder.java:134)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPlug
inObject(AbstractConfiguration.java:958)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:898)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:890)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigur
e(AbstractConfiguration.java:513)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize
(AbstractConfiguration.java:237)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(Abst
ractConfiguration.java:249)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerCo
ntext.java:545)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
261)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:163)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:119)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:291)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
112)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
24)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)


2018-02-19 05:51:07,650 main ERROR Unable to create file C:\Program Files\es\log
s\elasticsearch_index_indexing_slowlog.log java.io.IOException: Permission denial
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1012)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$Rol
lingFileManagerFactory.createManager(RollingFileManager.java:628)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$Rol
lingFileManagerFactory.createManager(RollingFileManager.java:608)
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(Abs
tractManager.java:113)
        at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager
(OutputStreamManager.java:115)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.get
FileManager(RollingFileManager.java:188)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.bu
ild(RollingFileAppender.java:144)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.bu
ild(RollingFileAppender.java:60)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build
(PluginBuilder.java:122)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPlug
inObject(AbstractConfiguration.java:958)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:898)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:890)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigur
e(AbstractConfiguration.java:513)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize
(AbstractConfiguration.java:237)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(Abst
ractConfiguration.java:249)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerCo
ntext.java:545)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
261)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:163)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:119)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:291)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
112)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
24)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)


2018-02-19 05:51:07,666 main ERROR Could not create plugin of type class org.apa
che.logging.log4j.core.appender.RollingFileAppender for element RollingFile: jav
a.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appe
nder.rolling.RollingFileManager$RollingFileManagerFactory@515aebb0] unable to cr
eate manager for [C:\Program Files\es\logs\elasticsearch_index_indexing_slowlog.
log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManage
r$FactoryData@436813f3[pattern=C:\Program Files\es\logs\elasticsearch_index_inde
xing_slowlog-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192,
policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRollove
rMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1,
 max=7, useMax=true), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c] %mark
er%.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateExce
ption: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFil
eManager$RollingFileManagerFactory@515aebb0] unable to create manager for [C:\Pr
ogram Files\es\logs\elasticsearch_index_indexing_slowlog.log] with data [org.apa
che.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@436813f3[
pattern=C:\Program Files\es\logs\elasticsearch_index_indexing_slowlog-%d{yyyy-MM
-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTrigger
ingPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1,
modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7, useMax=true), a
dvertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n, filePerm
issions=null, fileOwner=null]]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(Abs
tractManager.java:115)
        at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager
(OutputStreamManager.java:115)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.get
FileManager(RollingFileManager.java:188)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.bu
ild(RollingFileAppender.java:144)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.bu
ild(RollingFileAppender.java:60)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build
(PluginBuilder.java:122)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPlug
inObject(AbstractConfiguration.java:958)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:898)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:890)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigur
e(AbstractConfiguration.java:513)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize
(AbstractConfiguration.java:237)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(Abst
ractConfiguration.java:249)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerCo
ntext.java:545)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
261)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:163)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:119)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:291)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
112)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
24)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)


2018-02-19 05:51:07,681 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.lo
gging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: N
o factory method found for class org.apache.logging.log4j.core.appender.RollingF
ileAppender
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findF
actoryMethod(PluginBuilder.java:229)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build
(PluginBuilder.java:134)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPlug
inObject(AbstractConfiguration.java:958)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:898)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConf
iguration(AbstractConfiguration.java:890)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigur
e(AbstractConfiguration.java:513)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize
(AbstractConfiguration.java:237)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(Abst
ractConfiguration.java:249)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerCo
ntext.java:545)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
261)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:163)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigu
rator.java:119)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:291)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
112)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
24)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)


2018-02-19 05:51:07,681 main ERROR Null object returned for RollingFile in Appen
ders.
2018-02-19 05:51:07,681 main ERROR Null object returned for RollingFile in Appen
ders.
2018-02-19 05:51:07,681 main ERROR Null object returned for RollingFile in Appen
ders.
2018-02-19 05:51:07,697 main ERROR Null object returned for RollingFile in Appen
ders.
2018-02-19 05:51:07,697 main ERROR Unable to locate appender "rolling" for logge
r config "root"
2018-02-19 05:51:07,697 main ERROR Unable to locate appender "index_indexing_slo
wlog_rolling" for logger config "index.indexing.slowlog.index"
2018-02-19 05:51:07,697 main ERROR Unable to locate appender "index_search_slowl
og_rolling" for logger config "index.search.slowlog"
2018-02-19 05:51:07,697 main ERROR Unable to locate appender "deprecation_rollin
g" for logger config "org.elasticsearch.deprecation"
[2018-02-19T05:51:09,241][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] []
 uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: U
nable to access 'path.data' (C:\Program Files\es\data)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125
) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
112) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:86) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
24) ~[elasticsearch-cli-6.2.1.jar:6.2.1]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-c
li-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
 ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)
 ~[elasticsearch-6.2.1.jar:6.2.1]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (C:\Pro
gram Files\es\data)
        at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(File
PermissionUtils.java:70) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java
:307) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:
262) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.configure(Security.java:123) ~[e
lasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[ela
sticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elas
ticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
) ~[elasticsearch-6.2.1.jar:6.2.1]
        ... 6 more
Caused by: java.nio.file.AccessDeniedException: C:\Program Files\es\data
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.j
ava:83) ~[?:1.8.0_151]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.jav
a:97) ~[?:1.8.0_151]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.jav
a:102) ~[?:1.8.0_151]
        at sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSyste
mProvider.java:504) ~[?:1.8.0_151]
        at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_151]
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8
.0_151]
        at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_151]
        at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.j
ava:421) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(File
PermissionUtils.java:68) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java
:307) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:
262) ~[elasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Security.configure(Security.java:123) ~[e
lasticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[ela
sticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elas
ticsearch-6.2.1.jar:6.2.1]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121
) ~[elasticsearch-6.2.1.jar:6.2.1]
        ... 6 more

1 个答案:

答案 0 :(得分:1)

看起来您为Elasticsearch文件(数据,日志等)定义了自定义位置:

  

C:\ Program Files \ es \ data

     

C:\ Program Files \ es \ logs

但是,Elasticsearch没有足够的权限来访问/创建那里的文件(我正在挑选堆栈跟踪中的行):

[2018-02-19T05:51:09,241][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] []
 uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: U
nable to access 'path.data' (C:\Program Files\es\data)

2018-02-19 05:51:07,650 main ERROR Unable to create file C:\Program Files\es\log
s\elasticsearch_index_indexing_slowlog.log java.io.IOException: Permission denial
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)

Caused by: java.nio.file.AccessDeniedException: C:\Program Files\es\data

这确实可能发生,因为C:\Program Files\是系统目录并需要特权访问。

删除当前安装后,您可以尝试以下几个选项:

.zip安装应该很简单:

  • 下载.zip
  • 解压
  • 运行.\bin\elasticsearch.bat

.zip安装可能不起作用的原因可能是MSI安装已覆盖%ES_HOME%变量,现在任何Elasticsearch安装都使用损坏的配置。

希望有所帮助!