JMX connection between pods in Openshift JMX connection between pods in Openshift kubernetes kubernetes

JMX connection between pods in Openshift


Is it possible to make a JMX connection between different pods using IP service?

Yes, it should work seamlessly, either using the service IP address or the service name according to how DNS works in K8s.

Looks like the problem for you is this:

-Djava.rmi.server.hostname=127.0.0.1

This is basically binding to 127.0.0.1 only and allowing only local connections. You might want to try 0.0.0.0 so that external connections are allowed.

Hope it helps!


I'd guess, if you are seeing a connection refused error, that the service port is wrong. The reason is that "connection refused" itself means that the port isn't even open at all.

So, your probably just trying to access the service on the wrong IP.

This happens when, for example, you try to access a service port on a host IP. Remember, the service port is internal to the cluster, whereas the host port will expose this port on a (typically 5 digit) port.

To figure out, do oc get svc -o wide and look at the node port that your service is bound on.