Elasticsearch无法写入日志文件 [英] Elasticsearch can't write to log files

查看:286
本文介绍了Elasticsearch无法写入日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想激活弹性搜索的日志。



当我运行弹性搜索二进制文件时,我意识到我有日志记录问题:配置无法加载! p>

这是输出:

 〜$ sudo / usr / share /弹性搜索/ bin / elasticsearch 
无法配置日志记录...
org.elasticsearch.ElasticsearchException:无法在org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig( LogConfigurator.java:117)
在org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:81)
在org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java: 94)
在org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:178)
在org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
引起:java.nio.file.NoSuchFileException:/ usr / share / elasticsearch / config
at sun.nio.fs.UnixException.trans lateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews $ Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun .nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:97)
在java.nio.file.Files.readAttributes(Files.java:1686)
在java.nio.file.FileTreeWalker.walk (FileTreeWalker.java:109)
在java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)
在java.nio.file.Files.walkFileTree(Files.java:2602)
在org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:107)
... 4更多
log4j:WARN找不到appender(node) 。
log4j:WARN请正确初始化log4j系统。
log4j:WARN有关详细信息,请参阅http://logging.apache.org/log4j/1.2/faq.html#noconfig。
Java HotSpot(TM)服务器VM警告:您已加载库/usr/share/elasticsearch/lib/sigar/libsigar-x86-linux.so,这可能已禁用堆栈保护。虚拟机将尝试修复堆叠防护罩。
强烈建议您使用'execstack -c< libfile>'修复库,或者将其与-z noexecstack链接。

我正在linuxmint 17下运行并使用最新的ES。

解决方案

如果您使用软件包管理器安装弹性搜索器,如 yum apt-get 你不应该这样启动弹性搜索。尝试使用服务:例如 /etc/init.d/elasticsearch 或使用命令 sudo service elasticsearch start 您还应该检查logging.yml文件是否位于堆栈跟踪中提到的位置: / usr / share / elasticsearch / config





使用 sudo 开始弹性搜索不好,你可以做 sudo elasticsearch 作为弹性搜索用户运行,但我更喜欢使用第二句所述的服务调用。



希望帮助


I would like to activate logs of elasticsearch .

When I run elasticsearch binaries, I realize that I have problems with logging : the configuration cannot be loaded !

Here is the output :

~ $ sudo /usr/share/elasticsearch/bin/elasticsearch
Failed to configure logging...
org.elasticsearch.ElasticsearchException: Failed to load logging configuration
    at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:117)
    at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:81)
    at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:94)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:178)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
    at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:97)
    at java.nio.file.Files.readAttributes(Files.java:1686)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:109)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)
    at java.nio.file.Files.walkFileTree(Files.java:2602)
    at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:107)
    ... 4 more
log4j:WARN No appenders could be found for logger (node).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Java HotSpot(TM) Server VM warning: You have loaded library /usr/share/elasticsearch/lib/sigar/libsigar-x86-linux.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

I am running under linuxmint 17 and using latest ES.

解决方案

If you installed elasticsearch using a package manager like yum or apt-get you should not start elasticsearch this way. Try to use the service: for instance /etc/init.d/elasticsearch or using the command sudo service elasticsearch start

You should also check if the logging.yml file is at the location mentioned in the stack trace:/usr/share/elasticsearch/config

Using sudo to start elasticsearch is not good, you could do sudo elasticsearch to run as the elasticsearch user, but I prefer to use the service call as described in the second sentence.

Hope that helps

这篇关于Elasticsearch无法写入日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆