问题解决13:elasticsearch启动的时候报错,报日志文件没有权限解决方案

报错如下:

[esuser@izwz96zip5cr6qc2ws0vv8z bin]$ ./elasticsearch -d
[esuser@izwz96zip5cr6qc2ws0vv8z bin]$ 2019-03-13 13:26:52,897 main ERROR RollingFileManager (/usr/local/soft/elasticsearch-6.4.3/logs/myes.log) java.io.FileNotFoundException: /usr/local/soft/elasticsearch-6.4.3/logs/myes.log (Permission denied) java.io.FileNotFoundException: /usr/local/soft/elasticsearch-6.4.3/logs/myes.log (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.(FileOutputStream.java:213)
        at java.io.FileOutputStream.(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)

解决方案:
当前设置启动elasticsearch的用户是esuser

用chgrp和chown 命令对 /export/data/es/logs/文件 分别对每个文件进行授权
例:
chgrp esuser myes.log
chown es myes.log

最后就解决了。

你可能感兴趣的:(问题解决方案)