故障现象:

[elasticsearch@tiantianml-01 ~]$ /usr/local/elasticsearch/bin/elasticsearch
Exception in thread "main" SettingsException[Failed to load settings from /usr/local/elasticsearch/config/elasticsearch.yml]; nested: MarkedYAMLException[while scanning a simple key
 in 'reader', line 8, column 1:
    discovery.zen.ping.unicast.hosts ... 
    ^
could not find expected ':'
 in 'reader', line 9, column 1:
    
    ^

 at [Source: cluster.name: my-application
node.name: tiantianml-01
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
#bootstrap.memory_lock: false
network.host: 127.0.0.1
http.port: 9200
discovery.zen.ping.unicast.hosts:["tiantianml-01"]
...

出现这种错误的原因说明elasticsearch.yml这个配置文件的":"后面缺少空格,查看配置文件如下(果然缺少空格):

cluster.name: my-application
node.name: tiantianml-01
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
bootstrap.memory_lock: false
network.host: 127.0.0.1
http.port: 9200
discovery.zen.ping.unicast.hosts:["tiantianml-01"]

添加空格重新启动即可正常启动。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2021-06-25
猜你喜欢
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案