Elasticsearch 错误 – 未配置初始节点名

下载 elasticsearch 并解压后,未做任何配置,报错如下:

[2019-10-31T15:26:19,120][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks 
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

解决:

# 删除配置文件[config/elasticsearch.yml]中的注释
node.name: node-1
# 删除配置文件[config/elasticsearch.yml]中的的注释
cluster.initial_master_nodes: ["node-1"]