elasticsearch按照配置时遇到的一些坑 [Failed to load settings from [elasticsearch.yml]]
自己搞得錯(cuò)誤如下所示:
[root@localhost elasticsearch2.4]# ./bin/elasticsearch
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[while parsing a block mapping
?in 'reader', line 33, column 1:
? ? path.data: /data/elastic/data
? ??
expected <block end>, but found BlockMappingStart
?in 'reader', line 54, column 2:
? ? ?network.host: 192.168.116.137
? ? ?
這里整理幾個(gè)空格引起的問(wèn)題.
版本是elasticsearch-2.3.0 或者elasticsearch-rtf-master
Exception?in?thread?"main"?SettingsException[Failed?to?load?settings?from?[elasticsearch.yml]];?nested:?ElasticsearchParseException[malformed,?expected?settings?to?start?with?'object',?instead?was?[VALUE_STRING]];
這個(gè)錯(cuò)就是參數(shù)的冒號(hào)前后沒(méi)有加空格,加了之后就好,我找了好久這個(gè)問(wèn)題;
后來(lái)在一個(gè)外國(guó)網(wǎng)站找到了這句話.
Exception?in?thread?"main"?SettingsException[Failed?to?load?settings?from?[elasticsearch.yml]];?nested:?ElasticsearchParseException[malformed,?expected?end?of?settings?but?encountered?additional?content?starting?at?line?number:?[3],?column?number:?[1]];?nested:?ParserException[expected?'<document?start>',?but?found?BlockMappingStart
?in?'reader',?line?3,?column?1:
????node.rack?:?r1
????^
];
Likely?root?cause:?expected?'<document?start>',?but?found?BlockMappingStart
?in?'reader',?line?3,?column?1:
????node.rack?:?r1
這個(gè)是行的開(kāi)頭沒(méi)有加空格,fuck!
Exception?in?thread?"main"?SettingsException[Failed?to?load?settings?from?[elasticsearch.yml]];?nested:?ScannerException[while?scanning?a?simple?key
?in?'reader',?line?11,?column?2:
?????discovery.zen.ping.unicast.hosts?...?
?????^
參數(shù)冒號(hào)后加空格,或者是數(shù)組中間加空格
還有注釋掉的參數(shù)不能在#后邊加空格不然報(bào)錯(cuò)
例如:
# discovery.zen.minimum_master_nodes:?3
目前這個(gè)版本看來(lái)es官方程序員沒(méi)有在這上邊加驗(yàn)證,沒(méi)有做好處理;
參數(shù)上空格能解決好多問(wèn)題.
也許過(guò)一段時(shí)間這種腦殘的問(wèn)題就解決了,但是之前的版本貌似都有這類(lèi)問(wèn)題
來(lái)源:http://www.cnblogs.com/beautiful-code/p/6264441.html
總結(jié)
以上是生活随笔為你收集整理的elasticsearch按照配置时遇到的一些坑 [Failed to load settings from [elasticsearch.yml]]的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 壹传媒和壹基金的关系
- 下一篇: 全球主要外汇市场有哪些