linux - Elasticsearch 无法写入日志文件

标签 linux logging elasticsearch linux-mint

我想激活elasticsearch的日志。

当我运行 elasticsearch 二进制文件时,我意识到我的日志记录有问题:无法加载配置!

这是输出:

~ $ 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'.

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

最佳答案

如果您使用 yumapt-get 等包管理器安装 elasticsearch,则不应以这种方式启动 elasticsearch。尝试使用该服务:例如 /etc/init.d/elasticsearch 或使用命令 sudo service elasticsearch start

您还应该检查 logging.yml 文件是否位于堆栈跟踪中提到的位置:/usr/share/elasticsearch/config

使用 sudo 启动 elasticsearch 不好,您可以使用 sudo elasticsearch 以 elasticsearch 用户身份运行,但我更喜欢使用服务调用,如第二句。

希望有帮助

关于linux - Elasticsearch 无法写入日志文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24975895/

相关文章:

linux - 在 screen 中创建窗口

logging - "tail -f"使磁盘已满?

elasticsearch - Elasticsearch:使用脚本从数组生成术语

c - 彼得森算法的错误

linux - 使用 ffmpeg 从运行 linux 的 Pocketbeagle 通过 UDP 直播网络摄像头视频,缺少什么?

python - Pyramid 记录

actionscript-3 - AS3,Flash : Accessing error messages text in code

调试 groovy 脚本 elasticsearch

elasticsearch - 有关如何索引单词并对其类型(实体等)进行注释的说明,然后是Elasticsearch/w.e。返回这些带有注释的单词?

linux - bash - ATOM 文本编辑器没有这样的文件或目录