springboot整合ES-Rest-Client出现问题Timeout connecting to [localhost/127.0.0.1:9200] 原因 分析 解决

未知(小白初学)

分析

应该是springboot对es自动配置程序的自动配置为localhost:9200

springboot整合ES-Rest-Client出现问题Timeout connecting to [localhost/127.0.0.1:9200]
原因
分析
解决

解决

在application.properties配置如下
spring.elasticsearch.rest.uris=1.15.138.161:9200

插入数据到es中成功

(https://www.jianshu.com/p/7defb688c6c4)