欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

ElasticSearch7 设置外网访问失败

程序员文章站 2022-11-06 23:38:20
elasticsearch外网访问9200端口失败,bootstrap checks failed,the default discovery settings are unsuitable for production use; at least one of [discovery.seed_ho ......

elasticsearch外网访问9200端口失败,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中至少设置一项。

仔细看了官网文档:discovery.seed_hosts 设置成默认值即可。

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