I am trying to automate the execution step of some actions using JMX.
It works for a development environment. but when it comes to Production, which is protected behind a firewall, I need to create an SSH tunnel, and then only I can access the JMX console.
I used to use putty or ssh to create a tunnel and run my java program locally. Since we used 1-2 hosts, it was easier. Now it has become up to 10 hosts. Now that I don’t want to create a tunnel every time and turn off and start the program.
what I wanted to do was automatically create an SSH tunnel using JSch and connect JMX using a java program. I tried to do this, but did not work.
I get java.rmi.ConnectException: connection refused host: localhost; Nested exception: java.net.ConnectException: connection rejected: connect
It can be done?
coder source
share