什么会导致Elastic Search不生成日志文件?

时间:2016-11-10 21:06:57

标签: amazon-web-services ubuntu elasticsearch

我已经通过使用此tutorial from Elastic

给出的debian软件包在我的ubuntu64虚拟机上安装了Elastic Search V5.0

正如教程sudo -i service elasticsearch start中所解释的那样,不会在此处给出任何消息(设计不佳)

我尝试将STDOUT.log文件添加到目录中,并在启动弹性搜索后仍然为空

如果我sudo bin/elasticsearch我得到了这个痕迹:

Exception in thread "main" ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]]
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:70)
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:50)
        at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:50)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:938)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:927)
        at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)
        at org.elasticsearch.bootstrap.Bootstrap.initialEnvironment(Bootstrap.java:207)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:247)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103)
        at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
        at org.elasticsearch.cli.Command.main(Command.java:62)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73)

没有sudo provlidges:

Exception in thread "main" SettingsException[Failed to load settings from 

/usr/share/elasticsearch/config/elasticsearch.yml]; nested: AccessDeniedException[/usr/share/elasticsearch/config/elasticsearch.yml];
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config/elasticsearch.yml
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
        at java.nio.file.Files.newByteChannel(Files.java:361)
        at java.nio.file.Files.newByteChannel(Files.java:407)
        at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
        at java.nio.file.Files.newInputStream(Files.java:152)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:927)
        at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)
        at org.elasticsearch.bootstrap.Bootstrap.initialEnvironment(Bootstrap.java:207)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:247)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103)
        at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
        at org.elasticsearch.cli.Command.main(Command.java:62)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73)

我不喜欢在stackoverflow上发布这么多文本,但这里的配置位于:/etc/elasticsearch

# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
cluster.name: sdc-test-es-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
#node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

1 个答案:

答案 0 :(得分:0)

问题在于错误配置的Elasticsearch。

  1. 确保ES使用来自正确位置的配置文件。例如,&#34;没有sudo特权&#34;输出错误的位置。

  2. 确保您在配置中没有错误。

  3. 要隔离问题,请在配置中注释掉所有内容,然后逐行取消注释配置中的自定义设置,并尝试启动。如果找到导致问题的行,请检查文档。

    另外,尝试不用&#34; -d&#34;选项,Elasticsearch将在控制台中输出完整的堆栈跟踪,它应该告诉更多有关配置错误的设置。