找到问题的解决办法了么?

设置了自己的集群名称后就报NoNodeAvailableException[None of the configured nodes are available: ]求助!

Elasticsearch | 作者 xiangxiaolu | 发布于2018年05月16日 | 阅读数:8029

我的代码如下:首先配置9300,主机号,应该咩问题
Settings setting = Settings.builder().put("cluster.name","my-cluster").put("client.transport.sniff", true).build();
@SuppressWarnings("resource")
TransportClient client = new PreBuiltTransportClient(setting)
.addTransportAddress(new TransportAddress(InetAddress.getByName(HOST), 9300));
已邀请:

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

确认你的配置都是正确的吗? 
9300是tcp通讯端口,集群间和TCPClient都走的它,
9200是http协议的RESTful接口。
正常我们的开发不都是走9200端口吗?
 
确认下。

hw_cloudsearch - 云Elasticsearch:https://www.huaweicloud.com/product/es.html

赞同来自:

端口为啥是9300,不是9200?

medcl - 今晚打老虎。

赞同来自:

TransportClient 是9300没错,你需要确定的是这个 ip 是可以 ping 通和端口是可以 telnet 通的。

xiangxiaolu - 菜鸟

赞同来自:

感谢大家的回复,我的问题已经解决了。

要回复问题请先登录注册