2016-11-10 135 views
0

我已经通过使用这个tutorial from Elastic什么会导致Elastic Search不生成日志文件?

给出Debian的软件包安装弹性搜索V5.0我ubuntu64虚拟机上的教程解释sudo -i service elasticsearch start不会给这里的任何消息(设计不良IMO)

我尝试添加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) 

我不张贴计算器这么多文字的粉丝,但这里是我的配置位于:/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 

回答

0

问题是与配置错误Elasticsearch。

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

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

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

此外,尝试启动时没有“-d”选项,Elasticsearch将在控制台中输出完整的堆栈跟踪,它应该告诉更多关于错误配置的设置。