解决Elasticsearch外网访问的问题(楼主亲测)(复制的csdn上的)

地址:https://blog.csdn.net/wd2014610/article/details/89532638

一、外网访问问题

默认情况下,是不支持外网访问,如果你的Elasticsearch安装在其他机器上,你从外网去访问的时候,访问不到,不通。

那么需要修改配置。

修改:elasticsearch.yml文件

添加

network.host: 0.0.0.0

二、会报错

ERROR: [2] bootstrap checks failed

[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

[2]: 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

三、解决方案

1.针对问题1

[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

使用sudo用户修改文件:sudo vim /etc/sysctl.conf

添加一行配置:

vm.max_map_count=655360

查看是否生效:

sudo sysctl -p

2.针对问题2

[2]: 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

放开:

cluster.initial_master_nodes: ["node-1", "node-2"]

启动访问就可以了

你可能感兴趣的:(解决Elasticsearch外网访问的问题(楼主亲测)(复制的csdn上的))