启动 Elasticsearch 服务器时出现以下异常

Exception in thread "main" org.elasticsearch.common.settings.SettingsException: Failed to load settings from [file:/usr/local/elasticsearch-1.7.1/config/elasticsearch.yml]
        at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:985)
        at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromUrl(ImmutableSettings.java:969)
        at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:95)
        at org.elasticsearch.plugins.PluginManager.main(PluginManager.java:396)
Caused by: org.elasticsearch.ElasticsearchParseException: malformed, expected settings to start with 'object', instead was [VALUE_STRING]
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:66)
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:46)
        at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:46)
        at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:982)
        ... 3 more

最佳答案

我得到了这个问题。

我已经为 cluster.name 和 node.name 更新了 config/elasticsearch.yml,如下所示

cluster.name:my_elastic_cluster
node.name:"EL1_NODE"



我在 前后各加了一个空格: 并且成功了!!!
> cluster.name : my_elastic_cluster
> node.name : "EL1_NODE"

关于ElasticsearchParseException : malformed, 预期设置以 'object' 开头,而不是 [VALUE_STRING],我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32148476/

10-12 21:35