Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't have JConsole read Kafka JMX

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?

like image 260
kee Avatar asked Mar 18 '23 10:03

kee


2 Answers

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.

like image 137
kee Avatar answered Mar 30 '23 23:03

kee


In my case, setting -Djava.rmi.server.hostname=my_machine_hostname works.

like image 21
Ken Chen Avatar answered Mar 30 '23 21:03

Ken Chen