jstatd connection issue

1.7k Views Asked by At

I'm trying to run jstatd on an Amazon EC2 linux server we have with this:

jstatd -J-Djava.security.policy=/usr/lib/jvm/java-6-openjdk/bin/jstatd.all.policy -J-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx

and I get this result:

Could not contact registry
Connection refused to host: 10.212.XX.XX; nested exception is:
        java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: 10.212.XX.XX; nested exception is:
etc

But I've no idea why it's trying to connect to 10.212.XX.XX, it looks like an internal ip but it's not the internal ip of that server or any of our servers. Why is it trying to connect to this and how can I change it?

Notes: Above IP addresses are just for example to hide actual IPs

1

There are 1 best solutions below

0
On

I was having a hard time with the same problem, and I found the answer in another post.

In my particular case after troubleshooting another errors, I found that hostname -i was returning a weird IP address, not the one configured on the server.

The solution, was to edit /etc/hosts an add an entry for matching the server's ip address.

Perhaps is the same situation here.