[英]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.