在容器中运行 Tomcat 中的 Pulse 时,我需要在 Docker 容器上打开哪些端口?



我在Docker容器中运行Geode(v1.14.0(服务器/定位器。 我也在尝试将 Pulse 作为独立的 WAR 运行在 Docker 中的 Tomcat 中。 在容器外的Tomcat中运行Pulse WAR时,我可以正常连接,所以我怀疑这是端口或主机名问题。 我目前正在将容器内的 8080 映射到 8081。 我可以在浏览器中加载 Pulse UI,但它一直在页面顶部的黄色框中显示"Connecting...",并且找不到 Geode 定位器。

查看脉搏.log,我反复看到以下异常:

java.net.ConnectException: Connection refused (Connection refused)

脉冲属性配置为默认值:

# JMX Locator/Manager Properties
pulse.useLocator=true
pulse.host=localhost
pulse.port=10334
#pulse.useSSL.locator=true
#pulse.useSSL.manager=true

本质上,我使用以下命令启动 Geode 服务器/定位器节点:

docker run -it -p 7070:7070 -p 10334:10334 -p 40404:40404 -p 40405:40405 -p 40406:40406 -p 1099:1099 apachegeode/geode

需要打开哪些 Docker 端口才能使 Pulse 工作,是否需要任何特定的主机名配置?

根据@greenPadawan的评论(谢谢(,我按如下方式解决了这个问题:

在 Docker 中创建新网络 参考:docker network create --driver bridge geode

/WEB-INF/classes/pulse.properties的脉冲 WAR 文件中,我将pulse.host=localhost设置更改为pulse.host=geode。 然后,我用更新的 WAR 重新构建了我的 Pulse Docker 容器。

使用该网络启动我的两个容器(一个用于Geode,一个用于Pulse/Tomcat(:

docker run -it --network=geode --name geode -p 7070:7070 -p 10334:10334 -p 40404:40404 -p 40405:40405 -p 40406:40406 -p 1099:1099 apachegeode/geode
docker run -d -P --network=geode pulse

当我现在在主机上的浏览器中导航到 Pulse 时,Pulse 现在连接到 Geode 定位器。

最新更新