Elasticsearch 主要错误 RollingFileManager (C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log)

Elasticsearch main ERROR RollingFileManager (C:\Program Files\Elastic\Elasticsearch\6.4.0\logs\elasticsearch.log)

大约三天前,我在 Win 10 上的本地 Elasticsearch 安装没有任何问题。今天,当我尝试 运行 elasticsearch 时,它抛出了这个错误。我不明白这意味着什么,因为您可以在下面的屏幕截图中看到日志文件存在。为什么 ES 说 java.io.FileNotFoundException?这意味着什么,我应该用它做什么?非常感谢。

这是控制台日志

C:\Program Files\Elastic\Elasticsearch.4.0\bin
λ elasticsearch
2020-04-20 10:02:20,046 main ERROR RollingFileManager (C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log) java.io.FileNotFoundException: C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log (Access is denied) java.io.FileNotFoundException: C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log (Access is denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:640)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
        at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
        at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:145)
        at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
        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:163)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:119)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:294)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127)
        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:93)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86)

[org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@3e84448c] unable to create manager for [C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@4a7f959b[pattern=C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch-%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true), SizeBasedTriggeringPolicy(size=134217728)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=[%d{ISO8601}][%-5p ][%-25c{1.}                ] [] %marker%.-10000m%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@3e84448c] unable to create manager for [C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@4a7f959b[pattern=C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch-%d{yyyy-MM-dd}-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true), SizeBasedTriggeringPolicy(size=134217728)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n, filePermissions=null, fileOwner=null]]

看起来您更改了 elasticsearch 文件夹的所有权,或者现在 运行 另一个用户没有权限写入您的 elasticsearch 日志文件,正如错误消息中明确提到的那样。

C:\Program Files\Elastic\Elasticsearch.4.0\logs\elasticsearch.log (Access is denied)

请确保 运行 您的 elasticsearch 进程的用户可以访问此位置 C:\Program Files\Elastic\Elasticsearch.4.0\logs\.