我正在使用 thorntail microprofile 框架来监控一个简单的休息服务应用程序。openshift 上的应用程序部署工作正常,但运行状况监视器却没有,因为收到此消息:
就绪探测失败:获取http://10.116.0.57:8080/health/live:拨打 tcp 10.116.0.57:8080:连接:连接被拒绝
但是可以使用服务路由 url 访问健康服务,例如http://thorntail-myproject.apps-crc.testing/health/live并获得结果:
{"status":"UP","checks":[{"name":"server-state","status":"UP"}]}
HealthCheck 实现类中包含 Liveness 和 Readiness 注释。通过 pod 的远程容器 shell 执行 curl 时也会获得服务响应。
这些是我在 pom.xml 中使用的依赖项:
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>microprofile-health</artifactId>
</dependency>
</dependencies>
有任何想法吗?