我有一个在远程服务器-1(这是tomcat 8服务器)上运行的 Camel Web应用程序。我已经在此tomcat上附加了jolokia jvm代理,如下所示:
java -jar jolokia-jvm-1.3.5-agent.jar start <PID>
我通过访问
http://remote-server-1:port/jolokia
在本地计算机上收到以下响应-{
"request": {
"type": "version"
},
"value": {
"agent": "1.3.5",
"protocol": "7.2",
"config": {
"maxDepth": "15",
"discoveryEnabled": "true",
"maxCollectionSize": "0",
"agentId": "***.***.***.**-16224-35a7a114-jvm",
"debug": "false",
"agentType": "jvm",
"historyMaxEntries": "10",
"agentContext": "\/jolokia",
"maxObjects": "0",
"debugMaxEntries": "100"
},
"info": {
"product": "tomcat",
"vendor": "Apache",
"version": "8.0.35"
}
},
"timestamp": 1491307702,
"status": 200
}
我还在local-tomcat8.5上部署了hawtio.war。当我尝试连接到该远程代理时,我被重定向到登录页面。我无法弄清楚我要去哪里错了。谁能帮我这个?
最佳答案
从2.10.1开始:使用hawtio.proxyAllowlist
代替hawtio.proxyWhitelist
。 (感谢rastadrian指出。)
从hawtio 1.5.0开始,您需要将远程主机添加到hawtio.proxyWhitelist
系统属性。
http://hawt.io/docs/configuration/#configuration-properties
如果您使用的是hawtio.war
,则按如下所示修改其WEB-INF/web.xml
:
<servlet>
<servlet-name>jolokia-proxy</servlet-name>
<servlet-class>io.hawt.web.ProxyServlet</servlet-class>
<!--
Comma-separated list of allowed target hosts. It is required for security.
'*' allows all hosts but keep in mind it's vulnerable to security attacks.
-->
<init-param>
<param-name>proxyWhitelist</param-name>
<param-value>
localhost,
127.0.0.1,
remote-server-1
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
关于java - 无法从Hawtio仪表板连接到远程服务器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43206932/