So I have an EC2 server running Apache Kafka (testing). It has port 9111 for JMX and EC2 security setting changed to open the port.
I am trying to run JConsole on my Mac to read JMX metrics of this server but I got "Secure Connection Failed" message and then it asks whether I want to try without SSL. So I selected Insecure. Then I just got "Connection Failed: Retry?" error. There isn't much explanation this time. What went wrong? In the JXM configuration of Kafka, secure connection and authentification are disabled.
Any clue/insight?
It turned out that when you run your Java process in EC2 and you want to access its JMX, you have to specify "-Djava.net.preferIPv4Stack=true" in running your Java process. Also I had to open all ports and it was because RMI would use different ports. So I fixed the port RMI is going to use.
In my case, setting -Djava.rmi.server.hostname=my_machine_hostname works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With