- 背景
通过java API 连接es的时候9300端口无法访问, 提示如下错误:
[{#transport#-1}{eD3ouMadRCGvciJh4jzsMw}{127.199.116.213}{127.199.116.213:9300}]
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{eD3ouMadRCGvciJh4jzsMw}{127.199.116.213}{127.199.116.213:9300}]
- 原因
docker下安装的es默认集群名字为"docker-cluster", 而API 中不指定集群名的话, 默认为elasticsearch,从而导致无法连接.
- 解决
- 修改elasticsearch.yml文件中指定cluster名字;
- API中设定cluster名字
- 代办
无.