简体   繁体   English

通过JMX监控在Docker中运行的Spring Boot App

[英]Monitor Spring Boot App running in Docker via JMX

I am using docker swarm & Traefic to manage and deploy my containers. 我正在使用docker swarm&Traefic管理和部署我的容器。 Unfortunately, I didn't set it up and not sure details, all I do is just deploy my app there and everything taken care of. 不幸的是,我没有设置它,也不确定细节,我要做的就是将我的应用程序部署在那里,一切都得到了照顾。 I am running Spring Boot Apps, each app could have multiple instances. 我正在运行Spring Boot Apps,每个应用程序可能有多个实例。 Docker file is pretty simple, basically Docker文件非常简单,基本上

ENTRYPOINT java -jar /app.jar

And we use Traefic to manage it as well. 我们也使用Traefic对其进行管理。

I am trying to connect jconsole to different apps but not sure how to do it for remote app that runs in docker swarm remotely. 我正在尝试将jconsole连接到其他应用程序,但不确定如何远程运行在docker swarm中的远程应用程序。 Locally no issues. 在本地没有问题。

I read on an internet about setting JMX setting when starting java app but all information about connecting to app running in docker locally or with static IP. 我在互联网上阅读了有关在启动Java应用程序时设置JMX设置的信息,但有关在本地或使用静态IP连接到在docker中运行的应用程序的所有信息。 I imagine I do not have static IP to add to my configuration, it always assigned dynamicly. 我想我没有要添加到配置中的静态IP,它总是动态分配的。

Any advise or where to start look would be gladly appreciated 任何建议或从哪里开始看都将不胜感激

To map multiple containers, you can use the container hostname. 要映射多个容器,可以使用容器的主机名。 When you run a container like "docker run -ti ... --hostname test1 ..." or run a service "docker service create ... name= test1...". 当您运行“ docker run -ti ... --hostname test1 ...”之类的容器或运行服务“ docker service create ... name = test1 ...”时。

So, you have to hitting via hostname. 因此,您必须通过主机名进行访问。

Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过JMX监控spring-boot应用程序? - How to monitor a spring-boot application via JMX? 有没有办法使用 Java JMX Stackdriver 插件监控在 Google Cloud Run 中的 Docker 容器中运行的 Java 应用程序? - Is there a way to monitor to Java app running in Docker container in Google Cloud Run with Java JMX Stackdriver plugin? Spring Boot JMX ClassNotFoundException - Spring Boot JMX ClassNotFoundException 将命令行参数传递给在Docker中运行的Java应用程序(Spring Boot) - Pass command line args to Java app (Spring Boot) running in Docker 运行 Docker 内的 Spring 启动应用程序时出现异常 - Exception when running Spring Boot app inside of Docker 运行独立时,JMX不适用于Spring启动应用程序 - JMX not available for spring boot application when running standalone 通过 Postman 运行 Spring 启动应用程序时出错 - Getting error while running Spring boot app via Postman 如何在 spring boot 独立应用程序中激活 JMX 监控 - How to activate JMX monitoring in spring boot standalone app 如何在Spring Boot应用程序中将千分尺与jmx一起使用? - How do i use micrometer with jmx in spring boot app? 如何知道Spring Boot应用程序是通过mvn spring-boot:run或Java执行运行的 - How to know spring boot app is running via mvn spring-boot:run or java execution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM