2016-11-10 143 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將在控制檯中輸出完整的堆棧跟蹤,它應該告訴更多關於錯誤配置的設置。