Elasticsearch启动报FileNotFoundException: search_slowlog.json (Permission denied),带详细解决方法

Posted 秋9

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch启动报FileNotFoundException: search_slowlog.json (Permission denied),带详细解决方法相关的知识,希望对你有一定的参考价值。

【现象】

2021-07-06 11:54:25,559 main ERROR RollingFileManager (/opt/apps/es/elasticsearch/logs/elasticsearch_index_search_slowlog.json) java.io.FileNotFoundException: /opt/apps/es/elasticsearch/logs/elasticsearch_index_search_slowlog.json (Permission denied) java.io.FileNotFoundException: /opt/apps/es/elasticsearch/logs/elasticsearch_index_search_slowlog.json (Permission denied)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:291)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:234)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:155)
        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)

【解决方法】

root账号下执行如下脚本:


cd /opt/apps/es
chown -R es elasticsearch
chgrp -R esg elasticsearch

其中es是用户,esg是用户组。

执行截图:

执行完成后,再切换到es用户下,使用./elasticsearch启动es。

以上是关于Elasticsearch启动报FileNotFoundException: search_slowlog.json (Permission denied),带详细解决方法的主要内容,如果未能解决你的问题,请参考以下文章

Linux安装ElasticSearch启动报错的解决方法

Elasticsearch启动报错

ElasticSearch本人启动报错总结

elasticsearch-7.17.3启动报错,需要使用Java 11

elasticsearch启动报错:can not run elasticsearch as root

Elasticsearch启动报错