1. 相关环境

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>

2. 问题

当引入了spring-boot-start-actuator对项目中elasticsearch进行健康检查时报错:java.lang.NoClassDefFoundError: org/elasticsearch/client/Request

问题排查:

到这个包org.elasticsearch.client中去找,发现确实没有Request类

这个包是在引入spring-boot-starter-data-elasticsearch的时候一起引入进来的

试图改变包的版本,发现只有最新版本2.2.0中包含了org.elasticsearch.client.Request类

但是当我们把版本改到2.2.0的时候又会有新的错误,直接报: java.net.ConnectException: Connection refused

elasticsearch连不上了。

改变actuator的版本同样不能解决问题。

3. 解决办法

方法一
spring.data.elasticsearch.cluster-name=docker-cluster-50
spring.data.elasticsearch.cluster-nodes=ip:9300
spring.elasticsearch.rest.uris=["http://ip:9200"]
方法二
management.health.elasticsearch.enabled=false

最新文章

  1. C#多线程之线程池篇1
  2. aes加密C语言
  3. monads-are-elephants(转)
  4. 第21天 fastlane
  5. opencv通过dll调用matlab函数,图片作为参数
  6. iOS 数据库持久化
  7. oc-07-有参方法的调用
  8. 用RSA实现Web单点登录密码的加密传输
  9. ASP.net gridview控件RowEditing,RowUpdating,RowDeleting,RowCancelingEdit事件的触发
  10. 前端开发【第3篇:JavaScript序】
  11. linux中ip命令使用介绍
  12. 在C++的函数中如何指定一个数组,使得这个数组的大小由函数的输入值来决定
  13. CentOS 7 源码编译安装 Redis
  14. kbmmw 5.02发布
  15. Python+Selenium笔记(十一):配置selenium Grid
  16. 将本地的mongodb迁移到阿里云
  17. POJ 1944 Fiber Communications (枚举 + 并查集 OR 线段树)
  18. PHP中的mb_convert_encoding与iconv函数介绍
  19. win32串口编程
  20. Wasserstein距离 和 Lipschitz连续

热门文章

  1. ListSetAndMap
  2. python 上传多文件
  3. 状压dp做题笔记
  4. Educational Codeforces Round 50 (Rated for Div. 2) F - Relatively Prime Powers(数学+容斥)
  5. MyBatis注解Annotation介绍及Demo(转)
  6. Hdu 1247 Hat's Words(Trie树)
  7. hive-server 启动失败问题小记
  8. 用python实现的简易记牌器的demo
  9. [pytorch] PyTorch Hook
  10. C#操作 Access 2013(.accdb)的方法