ElasticSearch设置外网访问报错

bootstrap checks failed,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

Linux安装ElasticSearch,修改配置文件elasticsearch.yml 后启动失败。

  • CentOS Linux release 7.5
  • ElasticSearch version 7.3.0
  • Java openjdk version 1.8.0_222
vim /etc/elasticsearch/elasticsearch.yml
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#

查看日志 (npm 安装elasticsearch 日志路径 /var/log/elasticsearch)

[ERROR][o.e.b.Bootstrap] [localhost.localdomain] node validation exception
[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

翻译过来就是,在discovery.seed_hosts,discovery.seed_providers, cluster.initial_master_nodes中至少设置一项。

于是查找官网文档:

Important discovery and cluster formation settings

The default for this setting is 127.0.0.1, [::1]

discovery.seed_hosts 设置成默认值即可。

discovery.seed_hosts: ["127.0.0.1", "[::1]"]

 

你可能感兴趣的:(ElasticSearch)