我想激活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', or link it with '-z noexecstack'.
我在linuxmint 17下运行并使用最新的ES.
如果您使用类似管理程序安装了elasticsearch,yum
或者apt-get
您不应该以这种方式启动elasticsearch.尝试使用该服务:例如/etc/init.d/elasticsearch
或使用该命令sudo service elasticsearch start
您还应该检查logging.yml文件是否位于堆栈跟踪中提到的位置:/usr/share/elasticsearch/config
使用sudo
开始elasticsearch不好,你可以做sudo elasticsearch
,以作为elasticsearch用户的身份运行,但我更喜欢作为第二句描述使用该服务调用.
希望有所帮助
您的elasticsearch.yml
文件和logging.yml
文件将位于该/etc/elasticsearch
文件夹中.
在您的elasticsearch
文件夹中创建一个配置文件夹,/usr/share
并将.yml文件移动到config文件夹
现在运行/bin/elasticsearch start
它会工作.
以下这对我有用.
您的elasticsearch.yml文件以及logging.yml文件将位于/ etc/elasticsearch文件夹中.
在/ usr/share的elasticsearch文件夹中创建一个config文件夹,并将.yml文件移动到config文件夹