openshift - Jolokia 端点在开放式换档中不通过弹簧靴执行器暴露
问题描述
我有一个camel application which is running in spring boot 2
和骆驼路线是通过可视化的hawtio
。和all actuator endpoints are exposed including jolokia endpoint
this application is completely working in local
当我尝试在本地访问执行器端点时http://localhost:8080/actuator/
,我可以看到下面的端点以及其他 16 个端点(例如健康、信息等)
"jolokia": {
"href": "http://localhost:8080/actuator/jolokia",
"templated": false
}
我有deployed the in same Openshift
,但是当我尝试时,access actuator endpoints in Openshift
我可以看到only 16 endpoints without jolokia endpoint
应用程序启动登录local
INFO : Initializing Spring embedded WebApplicationContext
INFO : Root WebApplicationContext: initialization completed in 3543 ms
INFO : Registered '/actuator/jolokia' to jolokia-actuator-endpoint
INFO : Initialising hawtio services
INFO : Configuration will be discovered via system properties
INFO : Welcome to Hawtio 2.10.0
INFO : Starting hawtio authentication filter, JAAS authentication disabled
INFO : Initializing ExecutorService 'applicationTaskExecutor'
INFO : Detected and using LURCacheFactory: camel-caffeine-lrucache
INFO : Exposing 17 endpoint(s) beneath base path '/actuator'
应用程序启动登录Openshift
INFO : Initializing Spring embedded WebApplicationContext
INFO : Root WebApplicationContext: initialization completed in 3543 ms
INFO : Initialising hawtio services
INFO : Configuration will be discovered via system properties
INFO : Welcome to Hawtio 2.10.0
INFO : Starting hawtio authentication filter, JAAS authentication disabled
INFO : Initializing ExecutorService 'applicationTaskExecutor'
INFO : Detected and using LURCacheFactory: camel-caffeine-lrucache
INFO : Exposing 16 endpoint(s) beneath base path '/actuator'
INFO : Registered '/actuator/jolokia' to jolokia-actuator-endpoint
日志中缺少Openshift
,所以很明显它没有注册spring boot actuator
有什么想法why jolokia is not exposed via spring boot actuator
吗?
因此hawtio
无法访问骆驼路线(JMX)。
解决方案
Issue is resolved
Solution : Disable the default OpenJDK8 jolokia in Openshift
在本地
应用程序没有在 Openshift / Docker 中作为映像运行,在 tomcat 中作为正常的 Spring Boot 应用程序运行,所以我没有遇到这个问题。
在 Openshift 中
应用程序作为镜像实例在 openshift / Docker 中运行。该映像是使用基础 openJDK 8 创建的,该基础 openJDK 8 默认启用了 jolokia Red hat openshift 参考
我通过AB_JOLOKIA_OFF:true
在 openshift 环境变量中覆盖它来禁用它。
or either
如果您maven fabric8 plugin
在 pom 中使用来构建图像,那么您可以在 pom 本身中覆盖它的 jolokia 属性(我没有尝试过,但它可以根据文档进行)。
推荐阅读
- apigee - 如何获取 Apigee 代理的端点列表
- python - 按键获取 pandas 数据帧值
- reactjs - ReactJS 网站未在 AzureDevOps 中构建,在本地运行良好
- android - 无法获取专辑列表 Facebook GraphRequest Android
- assembly - 装配浮动控制输出
- python - 从课堂调用时图像未出现
- android - Android 上的 PositionalDataSource 刷新
- c# - 使用具有预定义小时数的日历进行初始化,7、11、15、19
- networking - 当对等方是我的软件时如何检测点对点 VPN
- java - 使用 Eclipse 进行 Azure Function JAVA 开发