java连接elasticsearch报错NoNodeAvailableException[None of the configured nodes are available: [{#transpo

在java端连接elasticsearch时,可以输出client信息,但是在做聚合查询求最大值时会报如下异常:

Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{aKmx1XNXTtqhLPNtDvhQVA}{192.168.184.128}{192.168.184.128:9300}]]

看了网上的一些说法,有的是说ip和端口号写的有问题,我检查了一下是对的,还有说是cluster.name有问题,我才明白这里面的cluster.name是要和elasticsearch.yml里面配置的要一样。之前以为这个名字就像kafka里面的group.name一样可以自定义。把cluster.name改为elasticsearch.yml里面一样的cluster.name就可以了。

猜你喜欢

转载自blog.csdn.net/QYHuiiQ/article/details/90576588
今日推荐