当前位置:   article > 正文

Docker 上 ElasticSearch 无法连接 9300 异常 None of the configured nodes are available: [{#transport#-1}

none of the configured nodes are available: [{#transport#-1}{dk9uldajq0q0gl2

ElasticSearch 无法连接 9300 异常 None of the configured nodes are available: [{#transport#-1}

1、9300端口访问失败

NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}……
  • 1

因为我是在 Docker 上面部署的,所以首先查看端口是否配置了映射
使用 docker ps 查看
在这里插入图片描述很明显,我的映射没问题

使用 docker logs [ESID]查看日志
结果发现
在这里插入图片描述ES 的 9300 只映射到了本地

解决办法:
在 elasticsearch.yml 中添加 transport.host: 0.0.0.0 就行了
在这里插入图片描述
重新启动 elasticsearch 即可
在这里插入图片描述

2、修改配置文件后重启失败

如果启动失败,且 使用 docker logs [ESID] 查看报以下错误的话

[2018-05-18T17:44:59,658][INFO ][o.e.b.BootstrapChecks    ] [gFOuNlS] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

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

解决办法:

1、报【1】 号错的话在 /etc/security/limits.conf 文件内 追加以下内容

* soft nofile 65536
* hard nofile 65536
  • 1
  • 2

此文件修改后需要重新登录用户,才会生效

2、报【2】 号错的话在 /etc/sysctl.conf文件内 追加以下内容:

vm.max_map_count=655360
  • 1

保存后,执行:
sysctl -p
重新启动 ES 即可

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号